diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-26 16:03:40 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-26 16:04:44 +0100 |
commit | 7146bde45fa2b2d6c15e688ef90f50b4a576451f (patch) | |
tree | fde43c951325c57679e2317aa69cca44db25dc76 /org.eclipse.jgit.test/tst/org/eclipse/jgit | |
parent | 284d2b5b9c909199956440d144db591ac89c8a7b (diff) | |
parent | 41406e278fb69df1dbf4dcb9a82dcb03f2a8d5d7 (diff) | |
download | jgit-7146bde45fa2b2d6c15e688ef90f50b4a576451f.tar.gz jgit-7146bde45fa2b2d6c15e688ef90f50b4a576451f.zip |
Merge branch 'stable-5.13' into stable-6.0
* stable-5.13:
Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation"
TreeRevFilter: fix wrong stop when the given path disappears
Change-Id: Ibd69e9d941ad9262b61dd0c4368e48cb82597a12
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java index 31629f3de9..5cce11aa1f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkPathFilter1Test.java @@ -15,6 +15,7 @@ import static org.junit.Assert.assertNull; import java.util.Collections; +import org.eclipse.jgit.dircache.DirCacheEntry; import org.eclipse.jgit.treewalk.filter.AndTreeFilter; import org.eclipse.jgit.treewalk.filter.PathFilterGroup; import org.eclipse.jgit.treewalk.filter.TreeFilter; @@ -253,4 +254,23 @@ public class RevWalkPathFilter1Test extends RevWalkTestCase { assertEquals(0, a.getParentCount()); assertNull(rw.next()); } + + @Test + public void testStopWhenPathDisappears() throws Exception { + DirCacheEntry file1 = file("src/d1/file1", blob("a")); + DirCacheEntry file2 = file("src/d1/file2", blob("a")); + DirCacheEntry file3 = file("src/d1/file3", blob("a")); + RevCommit a = commit(tree(file1)); + RevCommit b = commit(tree(file1, file2), a); + RevCommit c = commit(tree(file1, file3), a); + RevCommit d = commit(tree(file1, file2, file3), b, c); + filter("src/d1"); + markStart(d); + rw.setRewriteParents(false); + + assertCommit(d, rw.next()); + assertCommit(c, rw.next()); + assertCommit(b, rw.next()); + assertCommit(a, rw.next()); + } } |