diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-12 16:38:48 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-12 16:38:56 +0900 |
commit | 59ee33aee477620a6400cdbe46386cdaac8f4e18 (patch) | |
tree | 0e07774c73353e81f5dc3aebd97ae4bfe8abd772 | |
parent | 8f464883855240bf3ac80d792fa64dc56ea2674a (diff) | |
parent | b81092cc99f6c31fd6894263f1b4eb8038d5ed5f (diff) | |
download | jgit-59ee33aee477620a6400cdbe46386cdaac8f4e18.tar.gz jgit-59ee33aee477620a6400cdbe46386cdaac8f4e18.zip |
Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
Fix NoSuchFileException during directory cleanup in RefDirectory
Externalize warning message in RefDirectory.delete()
Suppress warning for trying to delete non-empty directory
Change-Id: Ied2d7a70c5544ff012687a1aeb6e07394d9bd6fd
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
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 83ecb98aba..268a0f9e97 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -692,6 +692,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 24bc7b5c98..72755cec1f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -753,6 +753,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 9d51f4b1de..68c6dbe94a 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 @@ -1286,13 +1286,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(); |