summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-03-21 16:07:11 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2019-03-21 16:07:23 +0100
commit08a5d2771d641b2f69e588ce11028d26323283aa (patch)
tree482d954808c6c78f37d8ee0c7817111d9936bc4b /org.eclipse.jgit
parent639d53721c47ecf9a079475270fca93580f6b746 (diff)
parentb29bb5cbb00748fb7a4f89c5177391282d7aef66 (diff)
downloadjgit-08a5d2771d641b2f69e588ce11028d26323283aa.tar.gz
jgit-08a5d2771d641b2f69e588ce11028d26323283aa.zip
Merge branch 'stable-5.0' into stable-5.1
* stable-5.0: Fix GC to delete empty fanout directories after repacking Change-Id: I5c0e7d59f137c27e4588f20f4472d3ea450cd59c Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java7
1 files changed, 5 insertions, 2 deletions
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 015d44e87f..e1ba130041 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
@@ -549,9 +549,12 @@ public class GC {
pm.update(1);
if (d.length() != 2)
continue;
- File[] entries = new File(objects, d).listFiles();
- if (entries == null)
+ File dir = new File(objects, d);
+ File[] entries = dir.listFiles();
+ if (entries == null || entries.length == 0) {
+ FileUtils.delete(dir, FileUtils.IGNORE_ERRORS);
continue;
+ }
for (File f : entries) {
checkCancelled();
String fName = f.getName();