From 667ac8b3189336efbdb0484e212c36beb4ed5338 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Mon, 27 Aug 2018 01:13:38 +0200 Subject: [PATCH] Fix NoSuchFileException during directory cleanup in RefDirectory Bug: 538285 Change-Id: Iab5c381a412cb2c2176af55189668c267ed29fbc Signed-off-by: Matthias Sohn (cherry picked from commit 8ab89ef066f91a7d39b705f4e61498f37291ffab) Signed-off-by: David Pursehouse --- .../org/eclipse/jgit/internal/storage/file/RefDirectory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 91f5d7dc8..8338b2c8a 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 @@ -1093,7 +1093,7 @@ private static void delete(final File file, final int depth, LockFile rLck) 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