diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2020-10-22 09:25:55 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2020-10-22 09:25:55 +0200 |
commit | e23bdf1c7cfcc6a9351c0b168c11a2ae62a9b063 (patch) | |
tree | d90241063304673b36a183602bfd71a2c121b4d9 | |
parent | dd593205a02ecf579f55738a98820be7bbf51e01 (diff) | |
download | jgit-e23bdf1c7cfcc6a9351c0b168c11a2ae62a9b063.tar.gz jgit-e23bdf1c7cfcc6a9351c0b168c11a2ae62a9b063.zip |
Ensure GC.deleteOrphans() can delete read-only orphaned files on Windows
Reported in https://www.eclipse.org/lists/jgit-dev/msg04005.html
Change-Id: I140a49a7f65a76aa2b67ec8d286a3d2506ae499a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java | 3 |
1 files changed, 2 insertions, 1 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 0899578e20..e4324c1a89 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 @@ -978,7 +978,8 @@ public class GC { } else { if (base == null || !n.startsWith(base)) { try { - Files.delete(packDir.resolve(n)); + FileUtils.delete(packDir.resolve(n).toFile(), + FileUtils.RETRY | FileUtils.SKIP_MISSING); } catch (IOException e) { LOG.error(e.getMessage(), e); } |