diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2015-12-02 09:16:03 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2015-12-13 01:24:46 +0100 |
commit | 5b55498b16267102b021a47b3a7c0bdbfae63e71 (patch) | |
tree | 5aa12541f672fb4a1e468ca7ce8e6f0f43210e3c | |
parent | 85d09a9ec7d599d0234efd53b924dc2767a3843b (diff) | |
download | jgit-5b55498b16267102b021a47b3a7c0bdbfae63e71.tar.gz jgit-5b55498b16267102b021a47b3a7c0bdbfae63e71.zip |
Fix FileTreeIterator.idSubmodule(Entry)
FileTreeIterator was calling by mistake
WorkingTreeIterator.idSubmodule(Entry). Instead it should always compute
idSubmodule on its own.
Change-Id: Id1b988aded06939b1d7edd2671e34bf756896c0e
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java | 2 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java index 863d79ddee..3259f622f3 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java @@ -87,7 +87,7 @@ public class IndexDiffSubmoduleTest extends RepositoryTestCase { .call(); submodule_db = (FileRepository) Git.wrap(db).submoduleAdd() - .setPath("submodule") + .setPath("modules/submodule") .setURI(submoduleStandalone.getDirectory().toURI().toString()) .call(); submoduleStandalone.close(); diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java index 8d2cb1d8cd..accf4956f6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java @@ -67,8 +67,8 @@ import org.eclipse.jgit.util.FS; */ public class FileTreeIterator extends WorkingTreeIterator { /** - * the starting directory. This directory should correspond to the root of - * the repository. + * the starting directory of this Iterator. All entries are located directly + * in this directory. */ protected final File directory; @@ -238,8 +238,6 @@ public class FileTreeIterator extends WorkingTreeIterator { @Override protected byte[] idSubmodule(final Entry e) { - if (repository == null) - return idSubmodule(getDirectory(), e); - return super.idSubmodule(e); + return idSubmodule(getDirectory(), e); } } |