]> source.dussan.org Git - jgit.git/commitdiff
Fix NoSuchFileException during directory cleanup in RefDirectory 94/128094/2
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 26 Aug 2018 23:13:38 +0000 (01:13 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 27 Aug 2018 07:12:02 +0000 (09:12 +0200)
Bug: 538285
Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java

index b088d726601338f041615c9704da16f567dfa023..450f3939a54d7e1c03a7129fbdf821c7931eeaee 100644 (file)
@@ -1287,7 +1287,7 @@ public class RefDirectory extends RefDatabase {
                File dir = file.getParentFile();
                for (int i = 0; i < depth; ++i) {
                        try {
-                               Files.delete(dir.toPath());
+                               Files.deleteIfExists(dir.toPath());
                        } catch (DirectoryNotEmptyException e) {
                                // Don't log; normal case when there are other refs with the
                                // same prefix