Merge "Only throw MissingObjectException when necessary"
This commit is contained in:
commit
56a1cced74
|
@ -117,6 +117,7 @@ BitmapBuilder findObjects(Set<? extends ObjectId> start, BitmapBuilder seen, boo
|
||||||
new AddUnseenToBitmapFilter(seen, bitmapResult));
|
new AddUnseenToBitmapFilter(seen, bitmapResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
while (walker.next() != null) {
|
while (walker.next() != null) {
|
||||||
// Iterate through all of the commits. The BitmapRevFilter does
|
// Iterate through all of the commits. The BitmapRevFilter does
|
||||||
// the work.
|
// the work.
|
||||||
|
@ -136,6 +137,20 @@ BitmapBuilder findObjects(Set<? extends ObjectId> start, BitmapBuilder seen, boo
|
||||||
bitmapResult.addObject(ro, ro.getType());
|
bitmapResult.addObject(ro, ro.getType());
|
||||||
pm.update(1);
|
pm.update(1);
|
||||||
}
|
}
|
||||||
|
} catch (MissingObjectException e) {
|
||||||
|
if (!ignoreMissingStart) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
// Even when none of the objects we started the walk from is missing,
|
||||||
|
// an object reachable from one can be. RevWalk and ObjectWalk don't
|
||||||
|
// provide a way to ignore the missing object and continue, so bail
|
||||||
|
// out early with an undersized bitmap.
|
||||||
|
//
|
||||||
|
// The resulting packfile is likely to be much too large, but that's
|
||||||
|
// better than serving an error.
|
||||||
|
//
|
||||||
|
// TODO(czhen): Resume the walk instead once RevWalk supports that.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return bitmapResult;
|
return bitmapResult;
|
||||||
|
|
Loading…
Reference in New Issue