diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-21 15:06:47 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-21 15:07:05 +0100 |
commit | f06de6b575f3f40ccd944ed2eb5c43d06666687f (patch) | |
tree | be677438cdd9ae9b64d6c2421626cec388c56f82 /org.eclipse.jgit/src/org | |
parent | f53c2d11af719cb1ff97ffc1c8046739883c30da (diff) | |
parent | 534ede2d8143093110ff9f20ff9b510c690db8d1 (diff) | |
download | jgit-f06de6b575f3f40ccd944ed2eb5c43d06666687f.tar.gz jgit-f06de6b575f3f40ccd944ed2eb5c43d06666687f.zip |
Merge branch 'stable-4.9' into stable-4.10
* stable-4.9:
Fix GC to delete empty fanout directories after repacking
Change-Id: Ibdbfe08eb290286fa738010bad1c604e857885cd
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org')
-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 45089feee1..5d9e604058 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(); |