]> source.dussan.org Git - jgit.git/commitdiff
Merge branch 'stable-4.6' 66/93166/2
authorMatthias Sohn <matthias.sohn@sap.com>
Wed, 15 Mar 2017 23:29:43 +0000 (00:29 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Wed, 15 Mar 2017 23:29:43 +0000 (00:29 +0100)
* stable-4.6:
  Don't remove pack when FileNotFoundException is transient

Change-Id: I82941a98385cda27c89e1e6750b7b6db4e39f414
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
1  2 
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java

index 1aa71e5a59455ffe25631b251a22a858145218f7,6489415ebbb3082d1f49ff0bd8db835a9df715c0..00e39533b10c7bb86406a30f5be751ba12357167
@@@ -576,14 -568,17 +582,17 @@@ public class ObjectDirectory extends Fi
                        removePack(p);
                } else if (e instanceof FileNotFoundException) {
                        if (p.getPackFile().exists()) {
-                               warnTmpl = JGitText.get().packInaccessible;
+                               errTmpl = JGitText.get().packInaccessible;
+                               transientErrorCount = p.incrementTransientErrorCount();
                        } else {
                                warnTmpl = JGitText.get().packWasDeleted;
+                               removePack(p);
                        }
-                       removePack(p);
 -              } else if (FileUtils.isStaleFileHandle(e)) {
 +              } else if (FileUtils.isStaleFileHandleInCausalChain(e)) {
                        warnTmpl = JGitText.get().packHandleIsStale;
                        removePack(p);
+               } else {
+                       transientErrorCount = p.incrementTransientErrorCount();
                }
                if (warnTmpl != null) {
                        if (LOG.isDebugEnabled()) {