diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-21 15:55:39 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-21 15:55:47 +0100 |
commit | b29bb5cbb00748fb7a4f89c5177391282d7aef66 (patch) | |
tree | 294657abf806325a7fa3fe0eb71106ccf0482f6a /org.eclipse.jgit | |
parent | 7480737aac78a2c6e1acca37715bf61a5fa494bb (diff) | |
parent | 1a289e342083d18fe4013bdb75004c079122df67 (diff) | |
download | jgit-b29bb5cbb00748fb7a4f89c5177391282d7aef66.tar.gz jgit-b29bb5cbb00748fb7a4f89c5177391282d7aef66.zip |
Merge branch 'stable-4.11' into stable-5.0
* stable-4.11:
Fix GC to delete empty fanout directories after repacking
Change-Id: Idce894a24e126e0fbe7bc9b6a3c64318f1a8eb75
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.java | 7 |
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 859db4821b..cfe0294650 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 @@ -548,9 +548,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(); |