diff options
author | Yunjie Li <yunjieli@google.com> | 2020-02-25 17:29:38 -0800 |
---|---|---|
committer | Yunjie Li <yunjieli@google.com> | 2020-02-26 12:03:58 -0800 |
commit | 7ba261fb5f516dce83adc6f3bd4ac1666a51193e (patch) | |
tree | a8b95b6e3922dd213ecf84cb9d2cab84609e2b90 /org.eclipse.jgit.test | |
parent | f63583928fc1784a98082e46fcb5d8c5445afb08 (diff) | |
download | jgit-7ba261fb5f516dce83adc6f3bd4ac1666a51193e.tar.gz jgit-7ba261fb5f516dce83adc6f3bd4ac1666a51193e.zip |
ObjectWalk: Add null check before skip tree.
currVisit could be null if a blob is marked as start point in
ObjectWalk. Add null check before skipping current tree.
Change-Id: Ic5d876fe2800f3373d136979be6c27d1bbd38dc1
Signed-off-by: Yunjie Li <yunjieli@google.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java index a3bfb71e40..da7b266125 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java @@ -216,4 +216,12 @@ public class ObjectWalkTest extends RevWalkTestCase { assertSame(rw.lookupBlob(bId), objw.nextObject()); assertNull(objw.nextObject()); } + + @Test + public void testSkipTreeWhenStartFromBlob() throws Exception { + final RevBlob f1 = blob("1"); + objw.markStart(f1); + assertSame(f1, objw.nextObject()); + objw.skipTree(); + } } |