Browse Source

Merge "ObjectWalk: Add null check before skip tree."

tags/v5.7.0.202003090808-r
Jonathan Nieder 4 years ago
parent
commit
fb45137a7c

+ 8
- 0
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java View File

assertSame(rw.lookupBlob(bId), objw.nextObject()); assertSame(rw.lookupBlob(bId), objw.nextObject());
assertNull(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();
}
} }

+ 3
- 1
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java View File

* @since 5.4 * @since 5.4
*/ */
public void skipTree() { public void skipTree() {
currVisit.ptr = currVisit.buf.length;
if (currVisit != null) {
currVisit.ptr = currVisit.buf.length;
}
} }


/** /**

Loading…
Cancel
Save