diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-21 16:47:08 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-03-21 16:47:14 +0100 |
commit | 5efcbaf7c3e475041de60670e4e1aec46b18334b (patch) | |
tree | e53da9ccb885e1fcabbc9fb89d571b51d2b16b62 /org.eclipse.jgit | |
parent | c490373e00792dbca03d548d72a2fde77fb2cae6 (diff) | |
parent | c23ccd29b5269e68aa23cbbba30b1b2df521e81f (diff) | |
download | jgit-5efcbaf7c3e475041de60670e4e1aec46b18334b.tar.gz jgit-5efcbaf7c3e475041de60670e4e1aec46b18334b.zip |
Merge branch 'stable-5.3'
* stable-5.3:
Fix GC to delete empty fanout directories after repacking
Change-Id: I080ddb03c6143f0bfa24707a10a4d926676d32b1
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 76ef1cf4d5..a791ac78e6 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(); |