]> source.dussan.org Git - jgit.git/commit
Only mark packfile invalid if exception signals permanent problem 44/93844/5
authorMatthias Sohn <matthias.sohn@sap.com>
Sat, 25 Mar 2017 01:33:06 +0000 (02:33 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 26 Mar 2017 09:40:47 +0000 (11:40 +0200)
commitaaf3c5154ea3b8a367266a7be7100ad7386a84b3
tree32514aaeaa4534c8f846f4e26b7564b450ed72dc
parent363a3657b133ea4668bd832410eff67cfdb7dfd1
Only mark packfile invalid if exception signals permanent problem

Add NoPackSignatureException and UnsupportedPackVersionException to
explicitly mark permanent unrecoverable problems with a pack

Assume problem with a pack is permanent only if we are sure the
exception signals a non-transient problem we can't recover from:
- AccessDeniedException: we lack permissions
- CorruptObjectException: we detected corruption
- EOFException: file ended unexpectedly
- NoPackSignatureException: pack has no pack signature
- NoSuchFileException: file has gone missing
- PackMismatchException: pack no longer matches its index
- UnpackException: unpacking failed
- UnsupportedPackIndexVersionException: unsupported pack index version
- UnsupportedPackVersionException: unsupported pack version

Do not attempt to handle Errors since they are thrown for serious
problems applications should not try to recover from.

Change-Id: I2c416ce2b0e23255c4fb03a3f9a0ee237f7a484a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/.settings/.api_filters [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/errors/NoPackSignatureException.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackIndexVersionException.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/errors/UnsupportedPackVersionException.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackIndex.java