Fix ObjectWalk corruption when skipping over empty trees
commitdb54736e714e3c7e8e54b38bbf9f1c2d0026d15d
authorShawn O. Pearce <spearce@spearce.org>
Tue, 2 Feb 2010 20:40:04 +0000 (2 12:40 -0800)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 2 Feb 2010 22:27:45 +0000 (2 14:27 -0800)
treead6640211caf29c90b154c419464e5a085a56b74
parent0d94a5ca666abbc787392565bbeb96c47dd36e7e
Fix ObjectWalk corruption when skipping over empty trees

The supplied test case comes out of the example tree identified by
Robert de Wilde and Ilari on #git:

  $ git ls-tree -rt a54f1a85ebf6a7f53aa60a45a1be33f8b078fb7e
  040000 tree bfe058ad536cdb12e127cde63b01472c960ea105    A
  040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904    A/A
  040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904    A/B
  100644 blob abbbfafe3129f85747aba7bfac992af77134c607    B

In this tree, "B" was being skipped because "A/A" as an empty tree
was immediately followed by "A/B", also an empty tree, but the
ObjectWalk broke out too early and never visited "B".

Bug: 286653
Change-Id: I25bcb0bc99d0cbbbdd9c2bd625ad6a691a6d0335
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/ObjectWalkTest.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/ObjectWalk.java