]> source.dussan.org Git - jgit.git/commitdiff
Fix NoSuchFileException during directory cleanup in RefDirectory 84/129184/1
authorMatthias Sohn <matthias.sohn@sap.com>
Sun, 26 Aug 2018 23:13:38 +0000 (01:13 +0200)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Wed, 12 Sep 2018 00:12:11 +0000 (09:12 +0900)
Bug: 538285
Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
(cherry picked from commit 8ab89ef066f91a7d39b705f4e61498f37291ffab)
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java

index 91f5d7dc8a131635b636c23e9e2be5a57d5a6b73..8338b2c8a2ee0a2ac3db451c200e42c7cf2b1b65 100644 (file)
@@ -1093,7 +1093,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