]> source.dussan.org Git - jgit.git/commitdiff
Skip unreachable garbage packs in dfs fsck 78/106478/1
authorZhen Chen <czhen@google.com>
Mon, 9 Oct 2017 17:53:58 +0000 (10:53 -0700)
committerZhen Chen <czhen@google.com>
Mon, 9 Oct 2017 18:00:32 +0000 (11:00 -0700)
Change-Id: I8899e0faf1e4e6386dfd57340dfa4f4fdebc3cf3
Signed-off-by: Zhen Chen <czhen@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsFsck.java

index 75eade2273efd01ebe8a40bfb22f49894fb19161..daaa2208406e60f1d25892623e0f7e70be6fb590 100644 (file)
@@ -55,6 +55,7 @@ import org.eclipse.jgit.internal.JGitText;
 import org.eclipse.jgit.internal.fsck.FsckError;
 import org.eclipse.jgit.internal.fsck.FsckError.CorruptIndex;
 import org.eclipse.jgit.internal.fsck.FsckPackParser;
+import org.eclipse.jgit.internal.storage.dfs.DfsObjDatabase.PackSource;
 import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.NullProgressMonitor;
 import org.eclipse.jgit.lib.ObjectChecker;
@@ -106,6 +107,10 @@ public class DfsFsck {
                try (DfsReader ctx = objdb.newReader()) {
                        for (DfsPackFile pack : objdb.getPacks()) {
                                DfsPackDescription packDesc = pack.getPackDescription();
+                               if (packDesc.getPackSource()
+                                               == PackSource.UNREACHABLE_GARBAGE) {
+                                       continue;
+                               }
                                try (ReadableChannel rc = objdb.openFile(packDesc, PACK)) {
                                        verifyPack(pm, errors, ctx, pack, rc);
                                } catch (MissingObjectException e) {