diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java index 8d934879e..3593c6101 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsReader.java @@ -332,15 +332,17 @@ public final class DfsReader extends ObjectReader implements ObjectReuseAsIs { OBJECT_SCAN: for (Iterator it = pending.iterator(); it.hasNext();) { T t = it.next(); - try { - long p = lastPack.findOffset(this, t); - if (0 < p) { - r.add(new FoundObject(t, lastIdx, lastPack, p)); - it.remove(); - continue; + if (!skipGarbagePack(lastPack)) { + try { + long p = lastPack.findOffset(this, t); + if (0 < p) { + r.add(new FoundObject(t, lastIdx, lastPack, p)); + it.remove(); + continue; + } + } catch (IOException e) { + // Fall though and try to examine other packs. } - } catch (IOException e) { - // Fall though and try to examine other packs. } for (int i = 0; i < packs.length; i++) {