aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-03-21 16:14:03 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2019-03-21 16:14:12 +0100
commit88fffedd99e64175260e2db7c55887395aba48ab (patch)
treede683049ea98c7c899d70bf32f9ce49fbcbb4478 /org.eclipse.jgit/src/org/eclipse
parent6a7a265b4d2da67dcebeb978d54416446e726eb7 (diff)
parent08a5d2771d641b2f69e588ce11028d26323283aa (diff)
downloadjgit-88fffedd99e64175260e2db7c55887395aba48ab.tar.gz
jgit-88fffedd99e64175260e2db7c55887395aba48ab.zip
Merge branch 'stable-5.1' into stable-5.2
* stable-5.1: Fix GC to delete empty fanout directories after repacking Change-Id: I0cf4d26bdee5ecee43e723c4176efbce777acabc 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/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();