Fix RevCommitList to work with subclasses of RevWalk

Bug: 321502
Change-Id: Ic4bc49a0da90234271aea7c0a4e344a1c3620cfc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2010-08-13 01:47:17 +02:00
parent cfe88d32a3
commit 35b01dac4c
1 changed files with 2 additions and 6 deletions

View File

@ -302,16 +302,13 @@ public void fillTo(final int highMark) throws MissingObjectException,
if (walker == null || size > highMark) if (walker == null || size > highMark)
return; return;
Generator p = walker.pending; RevCommit c = walker.next();
RevCommit c = p.next();
if (c == null) { if (c == null) {
walker.pending = EndGenerator.INSTANCE;
walker = null; walker = null;
return; return;
} }
enter(size, (E) c); enter(size, (E) c);
add((E) c); add((E) c);
p = walker.pending;
while (size <= highMark) { while (size <= highMark) {
int index = size; int index = size;
@ -331,9 +328,8 @@ public void fillTo(final int highMark) throws MissingObjectException,
final Object[] dst = s.contents; final Object[] dst = s.contents;
while (size <= highMark && index < BLOCK_SIZE) { while (size <= highMark && index < BLOCK_SIZE) {
c = p.next(); c = walker.next();
if (c == null) { if (c == null) {
walker.pending = EndGenerator.INSTANCE;
walker = null; walker = null;
return; return;
} }