summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-02-10 00:50:41 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2016-02-10 00:51:01 +0100
commit28e2fed761f0ddf01029c999b299ed0bccdf630e (patch)
treef7878683e3aef308a939015091c978bff2488431 /org.eclipse.jgit
parentc901cd89d35fe2cc014c7e0f5849e32a14fe679a (diff)
parent26012958a35d85639fe44fdbd4690cb58ec3b836 (diff)
downloadjgit-28e2fed761f0ddf01029c999b299ed0bccdf630e.tar.gz
jgit-28e2fed761f0ddf01029c999b299ed0bccdf630e.zip
Merge branch 'stable-4.2'
* stable-4.2: RepoProject: Fix warnings about variable hiding RepoTest: Open Git in try-with-resources RepositoryResolveTest: Open Git in try-with-resource RepositoryTestCase: Open autocloseable types in try-with-resource ResetCommandTest: Use Git member in testHardResetAfterSquashMerge ResolveMergerTest: Open Git in try-with-resource RevCommitListTest: Open Git and RevWalk in try-with-resource RevCommitParseTest: Open ObjectInserter.Formatter in try-with-resource RevObjectTest: Open RevWalk in try-with-resource RevTagParseTest: Open ObjectInserter.Formatter in try-with-resource RevertCommandTest: Open Git in try-with-resource SquashMessageFormatterTest: Open git in try-with-resource StatusCommandTest: Open Git in try-with-resource SubmoduleAddTest: Open Git in try-with-resource SymlinksTest: Open git and TreeWalk in try-with-resource T0003_BasicTest: Open autocloseable types in try-with-resource TextHashFunctions: Fix warnings about variable hiding TreeFilterTest: Open TreeWalk in try-with-resource TreeWalkJava7Test: Open TreeWalk in try-with-resource Fix diff for added and removed submodule Change-Id: If3ecc63f6dfac55474d3c1dd2f4105371f3d24fb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java3
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java12
2 files changed, 9 insertions, 6 deletions
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 4c0ed386e8..fc701f3a54 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
@@ -666,6 +666,9 @@ public class DiffFormatter implements AutoCloseable {
}
private static byte[] writeGitLinkText(AbbreviatedObjectId id) {
+ if (id.toObjectId().equals(ObjectId.zeroId())) {
+ return EMPTY;
+ }
return encodeASCII("Subproject commit " + id.name() //$NON-NLS-1$
+ "\n"); //$NON-NLS-1$
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
index 915066d58f..f6d1209cb5 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/gitrepo/RepoProject.java
@@ -252,10 +252,10 @@ public class RepoProject implements Comparable<RepoProject> {
/**
* Add a bunch of copyfile configurations.
*
- * @param copyfiles
+ * @param copyFiles
*/
- public void addCopyFiles(Collection<CopyFile> copyfiles) {
- this.copyfiles.addAll(copyfiles);
+ public void addCopyFiles(Collection<CopyFile> copyFiles) {
+ this.copyfiles.addAll(copyFiles);
}
/**
@@ -288,13 +288,13 @@ public class RepoProject implements Comparable<RepoProject> {
/**
* Check if this sub repo is an ancestor of the given path.
*
- * @param path
+ * @param thatPath
* path to be checked to see if it is within this repository
* @return true if this sub repo is an ancestor of the given path.
* @since 4.2
*/
- public boolean isAncestorOf(String path) {
- return path.startsWith(getPathWithSlash());
+ public boolean isAncestorOf(String thatPath) {
+ return thatPath.startsWith(getPathWithSlash());
}
@Override