summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-09-12 17:02:09 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-09-12 17:02:23 +0900
commit83c0369e29e4b4abc56010df34b5e2e29417ff9f (patch)
tree499f5bf969d2b6033c0e324e4d81e870c25bf87b
parent34618a4f86a322c2f57c0fd8043ab686d920a0c2 (diff)
parent59ee33aee477620a6400cdbe46386cdaac8f4e18 (diff)
downloadjgit-83c0369e29e4b4abc56010df34b5e2e29417ff9f.tar.gz
jgit-83c0369e29e4b4abc56010df34b5e2e29417ff9f.zip
Merge branch 'stable-4.10' into stable-4.11
* stable-4.10: Fix NoSuchFileException during directory cleanup in RefDirectory Externalize warning message in RefDirectory.delete() Suppress warning for trying to delete non-empty directory Change-Id: I191d56e3c0f11cf53076b06c7e7a05492c7a03f1 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r--org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java1
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java5
3 files changed, 5 insertions, 2 deletions
diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
index 3f845556e1..c5d03ba446 100644
--- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
+++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
@@ -698,6 +698,7 @@ truncatedHunkOldLinesMissing=Truncated hunk, at least {0} old lines is missing
tSizeMustBeGreaterOrEqual1=tSize must be >= 1
unableToCheckConnectivity=Unable to check connectivity.
unableToCreateNewObject=Unable to create new object: {0}
+unableToRemovePath=Unable to remove path ''{0}''
unableToStore=Unable to store {0}.
unableToWrite=Unable to write {0}
unauthorized=Unauthorized
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
index d3514344d8..6f306b8930 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
@@ -759,6 +759,7 @@ public class JGitText extends TranslationBundle {
/***/ public String tSizeMustBeGreaterOrEqual1;
/***/ public String unableToCheckConnectivity;
/***/ public String unableToCreateNewObject;
+ /***/ public String unableToRemovePath;
/***/ public String unableToStore;
/***/ public String unableToWrite;
/***/ public String unauthorized;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
index ad2d89afc5..106c84b7f3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java
@@ -1287,13 +1287,14 @@ public class RefDirectory extends RefDatabase {
File dir = file.getParentFile();
for (int i = 0; i < depth; ++i) {
try {
- Files.delete(dir.toPath());
+ Files.deleteIfExists(dir.toPath());
} catch (DirectoryNotEmptyException e) {
// Don't log; normal case when there are other refs with the
// same prefix
break;
} catch (IOException e) {
- LOG.warn("Unable to remove path {}", dir, e);
+ LOG.warn(MessageFormat.format(JGitText.get().unableToRemovePath,
+ dir), e);
break;
}
dir = dir.getParentFile();