Browse Source

Skip unreachable garbage packs in dfs fsck

Change-Id: I8899e0faf1e4e6386dfd57340dfa4f4fdebc3cf3
Signed-off-by: Zhen Chen <czhen@google.com>
stable-4.10
Zhen Chen 7 years ago
parent
commit
0f814a2a6c
  1. 5
      org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsFsck.java

5
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsFsck.java

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

Loading…
Cancel
Save