Merge "Use working tree iterator to compare file modes" into stable-2.0
diff --git a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java
index efdab42..91e57c0 100644
--- a/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java
+++ b/org.eclipse.jgit.ant/src/org/eclipse/jgit/ant/tasks/GitInitTask.java
@@ -48,7 +48,6 @@
import org.apache.tools.ant.Task;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
-import org.eclipse.jgit.api.errors.JGitInternalException;
/**
* Create an empty git repository.
diff --git a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
index ba7ee97..0accfc8 100644
--- a/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
+++ b/org.eclipse.jgit.junit.http/src/org/eclipse/jgit/junit/http/RecordingLogger.java
@@ -184,7 +184,6 @@ public void debug(Throwable thrown) {
// Ignore (not relevant to test failures)
}
- @SuppressWarnings("unused")
public void ignore(Throwable arg0) {
// Ignore (not relevant to test failures)
}
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index f4a3a62..1afc6d8 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -459,9 +459,13 @@ public RevCommit update(String ref, CommitBuilder to) throws Exception {
*/
public <T extends AnyObjectId> T update(String ref, T obj) throws Exception {
if (Constants.HEAD.equals(ref)) {
+ // nothing
} else if ("FETCH_HEAD".equals(ref)) {
+ // nothing
} else if ("MERGE_HEAD".equals(ref)) {
+ // nothing
} else if (ref.startsWith(Constants.R_REFS)) {
+ // nothing
} else
ref = Constants.R_HEADS + ref;
@@ -537,7 +541,9 @@ public <T extends RevObject> T parseBody(final T object) throws Exception {
*/
public BranchBuilder branch(String ref) {
if (Constants.HEAD.equals(ref)) {
+ // nothing
} else if (ref.startsWith(Constants.R_REFS)) {
+ // nothing
} else
ref = Constants.R_HEADS + ref;
return new BranchBuilder(ref);
diff --git a/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkIndex.java b/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkIndex.java
index 91a2d0e..89029c0 100644
--- a/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkIndex.java
+++ b/org.eclipse.jgit.storage.dht/src/org/eclipse/jgit/storage/dht/ChunkIndex.java
@@ -204,7 +204,6 @@ private static int selectOffsetFormat(List<? extends PackedObjectInfo> list) {
return fmt;
}
- @SuppressWarnings("unchecked")
private static void sortObjectList(List<? extends PackedObjectInfo> list) {
Collections.sort(list);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
index ceb4cb0..4258f74 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
@@ -963,7 +963,7 @@ private void assertHaveRepository() {
if (entry.getMode(side).getObjectType() != Constants.OBJ_BLOB)
return EMPTY;
- if (isBinary(entry.getPath(side)))
+ if (isBinary())
return BINARY;
AbbreviatedObjectId id = entry.getId(side);
@@ -1004,7 +1004,7 @@ private void assertHaveRepository() {
}
}
- private boolean isBinary(String path) {
+ private boolean isBinary() {
return false;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index 22a8558..4c29886 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -1015,10 +1015,9 @@ private static boolean isValidPath(CanonicalTreeParser t) {
}
private static boolean isValidPathSegment(CanonicalTreeParser t) {
- boolean isWindows = "Windows".equals(SystemReader.getInstance()
- .getProperty("os.name"));
- boolean isOSX = "Mac OS X".equals(SystemReader.getInstance()
- .getProperty("os.name"));
+ String osName = SystemReader.getInstance().getProperty("os.name");
+ boolean isWindows = "Windows".equals(osName);
+ boolean isOSX = "Darwin".equals(osName) || "Mac OS X".equals(osName);
boolean ignCase = isOSX || isWindows;
int ptr = t.getNameOffset();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
index 33c3623..7273150 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDatabase.java
@@ -219,5 +219,6 @@ public abstract RefRename newRename(String fromName, String toName)
* Implementors should overwrite this method if they use any kind of caches.
*/
public void refresh() {
+ // nothing
}
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsInserter.java
index 335e284e..0e02e00 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsInserter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsInserter.java
@@ -231,7 +231,6 @@ private void beginPack() throws IOException {
packOut.write(buf, 0, 12);
}
- @SuppressWarnings("unchecked")
private void sortObjectsById() {
Collections.sort(objectList);
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
index d9673f7..bcf0a8b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/HttpAuthMethod.java
@@ -277,12 +277,14 @@ private static String uri(URL u) {
r.append("://");
r.append(u.getHost());
if (0 < u.getPort()) {
- if (u.getPort() == 80 && "http".equals(u.getProtocol()))
- /* nothing */;
- else if (u.getPort() == 443 && "https".equals(u.getProtocol()))
- /* nothing */;
- else
+ if (u.getPort() == 80 && "http".equals(u.getProtocol())) {
+ /* nothing */
+ } else if (u.getPort() == 443
+ && "https".equals(u.getProtocol())) {
+ /* nothing */
+ } else {
r.append(':').append(u.getPort());
+ }
}
r.append(u.getPath());
if (u.getQuery() != null)
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
index 9b06132..f2d3c8c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/URIish.java
@@ -591,15 +591,14 @@ private static boolean eq(final String a, final String b) {
* @return the URI, including its password field, if any.
*/
public String toPrivateString() {
- return format(true, false, false);
+ return format(true, false);
}
public String toString() {
- return format(false, false, false);
+ return format(false, false);
}
- private String format(final boolean includePassword, boolean escape,
- boolean escapeNonAscii) {
+ private String format(final boolean includePassword, boolean escapeNonAscii) {
final StringBuilder r = new StringBuilder();
if (getScheme() != null) {
r.append(getScheme());
@@ -646,7 +645,7 @@ private String format(final boolean includePassword, boolean escape,
* @return the URI as an ASCII string. Password is not included.
*/
public String toASCIIString() {
- return format(false, true, true);
+ return format(false, true);
}
/**
@@ -654,7 +653,7 @@ public String toASCIIString() {
* such that it will be valid for use over the network.
*/
public String toPrivateASCIIString() {
- return format(true, true, true);
+ return format(true, true);
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
index c181a7a..f04bb6f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/FS_POSIX.java
@@ -105,6 +105,6 @@ public String run() {
return System.getProperty("os.name");
}
});
- return "Mac OS X".equals(osDotName);
+ return "Mac OS X".equals(osDotName) || "Darwin".equals(osDotName);
}
}
diff --git a/pom.xml b/pom.xml
index 09deec6..ad17122 100644
--- a/pom.xml
+++ b/pom.xml
@@ -183,11 +183,6 @@
<id>jgit-repository</id>
<url>http://download.eclipse.org/jgit/maven</url>
</repository>
- <repository>
- <id>jetty</id>
- <layout>p2</layout>
- <url>http://download.eclipse.org/jetty/updates/jetty-bundles-7.x/${jetty-version}/</url>
- </repository>
</repositories>
<build>