exceptionCaughtDuringExecutionOfTagCommand=Exception caught during execution of tag command
exceptionOccurredDuringAddingOfOptionToALogCommand=Exception occurred during adding of {0} as option to a Log command
exceptionOccurredDuringReadingOfGIT_DIR=Exception occurred during reading of $GIT_DIR/{0}. {1}
+exceptionWhileReadingPack=ERROR: Exception caught while accessing pack file {0}, the pack file might be corrupt
expectedACKNAKFoundEOF=Expected ACK/NAK, found EOF
expectedACKNAKGot=Expected ACK/NAK, got: {0}
expectedBooleanStringValue=Expected boolean string value
/***/ public String exceptionCaughtDuringExecutionOfTagCommand;
/***/ public String exceptionOccurredDuringAddingOfOptionToALogCommand;
/***/ public String exceptionOccurredDuringReadingOfGIT_DIR;
+ /***/ public String exceptionWhileReadingPack;
/***/ public String expectedACKNAKFoundEOF;
/***/ public String expectedACKNAKGot;
/***/ public String expectedBooleanStringValue;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
p.resolve(matches, id, RESOLVE_ABBREV_LIMIT);
} catch (IOException e) {
// Assume the pack is corrupted.
- //
+ logCorruptPackError(e, p);
removePack(p);
}
if (matches.size() > RESOLVE_ABBREV_LIMIT)
continue SEARCH;
} catch (IOException e) {
// Assume the pack is corrupted.
+ logCorruptPackError(e, p);
removePack(p);
}
}
continue SEARCH;
} catch (IOException e) {
// Assume the pack is corrupted.
+ logCorruptPackError(e, p);
removePack(p);
}
}
continue SEARCH;
} catch (IOException e) {
// Assume the pack is corrupted.
- //
+ logCorruptPackError(e, p);
removePack(p);
}
}
h.db.selectObjectRepresentation(packer, otp, curs);
}
+ private static void logCorruptPackError(IOException e, PackFile p) {
+ StringBuilder buf = new StringBuilder(MessageFormat.format(
+ JGitText.get().exceptionWhileReadingPack,
+ p.getPackFile().getAbsolutePath()));
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ buf.append('\n');
+ buf.append(sw.toString());
+ // TODO instead of syserr we should use a logging framework
+ System.err.println(buf.toString());
+ }
+
@Override
InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
boolean createDuplicate) throws IOException {