diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-12 15:55:07 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-09-12 15:55:07 +0900 |
commit | b81092cc99f6c31fd6894263f1b4eb8038d5ed5f (patch) | |
tree | 616aed1061be829f7678d4458a19fd51f62b67c7 /org.eclipse.jgit | |
parent | de0a6879484e1a31dee4ccc5ad2ca9856d6b0746 (diff) | |
parent | db756e914708ff29d93c2cba040aa19ea1a485c6 (diff) | |
download | jgit-b81092cc99f6c31fd6894263f1b4eb8038d5ed5f.tar.gz jgit-b81092cc99f6c31fd6894263f1b4eb8038d5ed5f.zip |
Merge branch 'stable-4.8' into stable-4.9
* stable-4.8:
Fix NoSuchFileException during directory cleanup in RefDirectory
Externalize warning message in RefDirectory.delete()
Suppress warning for trying to delete non-empty directory
Change-Id: I5e6cc35f3673545e7ff857e6ed0bcd2c44e50316
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit')
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 c2a033a879..f717cdcb98 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -684,6 +684,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 b990f0a9a1..ec19cdc2c2 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -743,6 +743,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 d3d01aac60..4003b27c31 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 @@ -1275,13 +1275,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(); |