]> source.dussan.org Git - jgit.git/commitdiff
GC#deleteOrphans: log warning for deleted orphaned files 61/172861/4
authorMatthias Sohn <matthias.sohn@sap.com>
Wed, 25 Nov 2020 23:58:03 +0000 (00:58 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Thu, 26 Nov 2020 00:34:42 +0000 (01:34 +0100)
Change-Id: Ie245bf5c8c924dfb1f0f40b8bcdcb1e6f5815526
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java

index 4251be8121c50b9e8339e5bd79e9e4c537c7a46b..c97b61b5ae3056e30d9e2562e9b19e20839cdcd6 100644 (file)
@@ -203,6 +203,7 @@ deepenNotWithDeepen=Cannot combine deepen with deepen-not
 deepenSinceWithDeepen=Cannot combine deepen with deepen-since
 deleteBranchUnexpectedResult=Delete branch returned unexpected result {0}
 deleteFileFailed=Could not delete file {0}
+deletedOrphanInPackDir=Deleted orphaned file {}
 deleteRequiresZeroNewId=Delete requires new ID to be zero
 deleteTagUnexpectedResult=Delete tag returned unexpected result {0}
 deletingNotSupported=Deleting {0} not supported.
index c827834479ae6953d556baa3aacc545b7fa07650..45f98ceb27d68e17c3bfa659067a2d3837b1e5fe 100644 (file)
@@ -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;
index 5bc2052f85550c69c335373dba5a18007cd6ec9c..0d8d979087ee4d255917329be3d9b5996e8f885a 100644 (file)
@@ -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);
                                        }