diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2014-02-02 23:26:34 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2014-02-03 14:51:11 +0100 |
commit | 871ee53b52a7e7f6a0fe600a054ec78f8e4bff5a (patch) | |
tree | 61978b3a73d0b27eedf88c05a4861851026a3895 /org.eclipse.jgit.test/tst/org | |
parent | 5404e70dc64201786cd6a21efb41310912860122 (diff) | |
download | jgit-871ee53b52a7e7f6a0fe600a054ec78f8e4bff5a.tar.gz jgit-871ee53b52a7e7f6a0fe600a054ec78f8e4bff5a.zip |
Reset internal state canonical length in WorkingTreeIterator when moving
Bug: 426514
Change-Id: Ifb75a4fa12291aeeece3dda129a65f0c1fd5e0eb
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java index 4ce4c8d04f..0bd1e9a920 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java @@ -56,9 +56,9 @@ import org.eclipse.jgit.api.Git; import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheCheckout; import org.eclipse.jgit.dircache.DirCacheEditor; +import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.dircache.DirCacheIterator; -import org.eclipse.jgit.dircache.DirCacheEditor.PathEdit; import org.eclipse.jgit.errors.CorruptObjectException; import org.eclipse.jgit.errors.IncorrectObjectTypeException; import org.eclipse.jgit.errors.MissingObjectException; @@ -99,6 +99,19 @@ public class FileTreeIteratorTest extends RepositoryTestCase { } @Test + public void testGetEntryContentLength() throws Exception { + final FileTreeIterator fti = new FileTreeIterator(db); + fti.next(1); + assertEquals(3, fti.getEntryContentLength()); + fti.back(1); + assertEquals(2, fti.getEntryContentLength()); + fti.next(1); + assertEquals(3, fti.getEntryContentLength()); + fti.reset(); + assertEquals(2, fti.getEntryContentLength()); + } + + @Test public void testEmptyIfRootIsFile() throws Exception { final File r = new File(trash, paths[0]); assertTrue(r.isFile()); |