|
|
@ -114,6 +114,8 @@ public class ObjectDirectory extends FileObjectDatabase { |
|
|
|
/** Maximum number of candidates offered as resolutions of abbreviation. */ |
|
|
|
/** Maximum number of candidates offered as resolutions of abbreviation. */ |
|
|
|
private static final int RESOLVE_ABBREV_LIMIT = 256; |
|
|
|
private static final int RESOLVE_ABBREV_LIMIT = 256; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String STALE_FILE_HANDLE_MSG = "stale file handle"; //$NON-NLS-1$
|
|
|
|
|
|
|
|
|
|
|
|
private final Config config; |
|
|
|
private final Config config; |
|
|
|
|
|
|
|
|
|
|
|
private final File objects; |
|
|
|
private final File objects; |
|
|
@ -554,22 +556,35 @@ public class ObjectDirectory extends FileObjectDatabase { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void handlePackError(IOException e, PackFile p) { |
|
|
|
private void handlePackError(IOException e, PackFile p) { |
|
|
|
String tmpl; |
|
|
|
String warnTmpl = null; |
|
|
|
if ((e instanceof CorruptObjectException) |
|
|
|
if ((e instanceof CorruptObjectException) |
|
|
|
|| (e instanceof PackInvalidException)) { |
|
|
|
|| (e instanceof PackInvalidException)) { |
|
|
|
tmpl = JGitText.get().corruptPack; |
|
|
|
warnTmpl = JGitText.get().corruptPack; |
|
|
|
// Assume the pack is corrupted, and remove it from the list.
|
|
|
|
// Assume the pack is corrupted, and remove it from the list.
|
|
|
|
removePack(p); |
|
|
|
removePack(p); |
|
|
|
} else if (e instanceof FileNotFoundException) { |
|
|
|
} else if (e instanceof FileNotFoundException) { |
|
|
|
tmpl = JGitText.get().packWasDeleted; |
|
|
|
warnTmpl = JGitText.get().packWasDeleted; |
|
|
|
|
|
|
|
removePack(p); |
|
|
|
|
|
|
|
} else if (e.getMessage() != null |
|
|
|
|
|
|
|
&& e.getMessage().toLowerCase().contains(STALE_FILE_HANDLE_MSG)) { |
|
|
|
|
|
|
|
warnTmpl = JGitText.get().packHandleIsStale; |
|
|
|
removePack(p); |
|
|
|
removePack(p); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (warnTmpl != null) { |
|
|
|
|
|
|
|
if (LOG.isDebugEnabled()) { |
|
|
|
|
|
|
|
LOG.debug(MessageFormat.format(warnTmpl, |
|
|
|
|
|
|
|
p.getPackFile().getAbsolutePath()), e); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
LOG.warn(MessageFormat.format(warnTmpl, |
|
|
|
|
|
|
|
p.getPackFile().getAbsolutePath())); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
tmpl = JGitText.get().exceptionWhileReadingPack; |
|
|
|
|
|
|
|
// Don't remove the pack from the list, as the error may be
|
|
|
|
// Don't remove the pack from the list, as the error may be
|
|
|
|
// transient.
|
|
|
|
// transient.
|
|
|
|
|
|
|
|
LOG.error(MessageFormat.format( |
|
|
|
|
|
|
|
JGitText.get().exceptionWhileReadingPack, p.getPackFile() |
|
|
|
|
|
|
|
.getAbsolutePath()), e); |
|
|
|
} |
|
|
|
} |
|
|
|
LOG.error(MessageFormat.format(tmpl, |
|
|
|
|
|
|
|
p.getPackFile().getAbsolutePath()), e); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|