diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-26 16:05:17 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-26 16:06:00 +0100 |
commit | f77519775d7cd5638be71e91f70ff11fd653e6c5 (patch) | |
tree | 2fa6e5201a1705c5d4ea6de7e9fd44473a7e1bc7 /org.eclipse.jgit.test/tst/org/eclipse | |
parent | ab8a5a3ccbb31d3aec4199f17b950096460940e0 (diff) | |
parent | 7146bde45fa2b2d6c15e688ef90f50b4a576451f (diff) | |
download | jgit-f77519775d7cd5638be71e91f70ff11fd653e6c5.tar.gz jgit-f77519775d7cd5638be71e91f70ff11fd653e6c5.zip |
Merge branch 'stable-6.0'
* stable-6.0:
Revert "RefDirectory.scanRef: Re-use file existence check done in snapshot creation"
TreeRevFilter: fix wrong stop when the given path disappears
Change-Id: Id7540d03991cdcf6f405e946b8cbbcc6a9696a31
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse')
-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()); + } } |