aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2020-11-26 00:58:03 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2020-11-26 01:34:42 +0100
commit0f1735de0be732e177fc7eb3b32e4d4b41f999cf (patch)
treef6ca81c72d8584098be923b0f9c7b5dc41763b47 /org.eclipse.jgit/src/org/eclipse
parent3996408cdefccadaf64ec3e0a4e84c8206ca4f90 (diff)
downloadjgit-0f1735de0be732e177fc7eb3b32e4d4b41f999cf.tar.gz
jgit-0f1735de0be732e177fc7eb3b32e4d4b41f999cf.zip
GC#deleteOrphans: log warning for deleted orphaned files
Change-Id: Ie245bf5c8c924dfb1f0f40b8bcdcb1e6f5815526 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse')
-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/GC.java4
2 files changed, 4 insertions, 1 deletions
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 c827834479..45f98ceb27 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
@@ -264,6 +264,7 @@ public class JGitText extends TranslationBundle {
/***/ public String deepenSinceWithDeepen;
/***/ public String deleteBranchUnexpectedResult;
/***/ public String deleteFileFailed;
+ /***/ public String deletedOrphanInPackDir;
/***/ public String deleteRequiresZeroNewId;
/***/ public String deleteTagUnexpectedResult;
/***/ public String deletingNotSupported;
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
index 5bc2052f85..0d8d979087 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -1001,7 +1001,9 @@ public class GC {
} else {
if (base == null || !n.startsWith(base)) {
try {
- Files.delete(packDir.resolve(n));
+ Path delete = packDir.resolve(n);
+ Files.delete(delete);
+ LOG.warn(JGitText.get().deletedOrphanInPackDir, delete);
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}