Browse Source

Fix FileTreeIterator.idSubmodule(Entry)

FileTreeIterator was calling by mistake
WorkingTreeIterator.idSubmodule(Entry). Instead it should always compute
idSubmodule on its own.

Change-Id: Id1b988aded06939b1d7edd2671e34bf756896c0e
stable-4.3
Christian Halstrick 9 years ago committed by Matthias Sohn
parent
commit
5b55498b16
  1. 2
      org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java
  2. 6
      org.eclipse.jgit/src/org/eclipse/jgit/treewalk/FileTreeIterator.java

2
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/IndexDiffSubmoduleTest.java

@ -87,7 +87,7 @@ public class IndexDiffSubmoduleTest extends RepositoryTestCase {
.call(); .call();
submodule_db = (FileRepository) Git.wrap(db).submoduleAdd() submodule_db = (FileRepository) Git.wrap(db).submoduleAdd()
.setPath("submodule") .setPath("modules/submodule")
.setURI(submoduleStandalone.getDirectory().toURI().toString()) .setURI(submoduleStandalone.getDirectory().toURI().toString())
.call(); .call();
submoduleStandalone.close(); submoduleStandalone.close();

6
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 { public class FileTreeIterator extends WorkingTreeIterator {
/** /**
* the starting directory. This directory should correspond to the root of * the starting directory of this Iterator. All entries are located directly
* the repository. * in this directory.
*/ */
protected final File directory; protected final File directory;
@ -238,8 +238,6 @@ public class FileTreeIterator extends WorkingTreeIterator {
@Override @Override
protected byte[] idSubmodule(final Entry e) { protected byte[] idSubmodule(final Entry e) {
if (repository == null)
return idSubmodule(getDirectory(), e); return idSubmodule(getDirectory(), e);
return super.idSubmodule(e);
} }
} }

Loading…
Cancel
Save