From: Matthias Sohn Date: Sun, 26 Aug 2018 23:13:38 +0000 (+0200) Subject: Fix NoSuchFileException during directory cleanup in RefDirectory X-Git-Tag: v5.1.0.201808281540-m3~3^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F94%2F128094%2F2;p=jgit.git Fix NoSuchFileException during directory cleanup in RefDirectory Bug: 538285 Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc Signed-off-by: Matthias Sohn --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java index b088d72660..450f3939a5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/RefDirectory.java @@ -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