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>
This commit is contained in:
parent
dd593205a0
commit
e23bdf1c7c
|
@ -978,7 +978,8 @@ private void deleteOrphans() {
|
||||||
} else {
|
} else {
|
||||||
if (base == null || !n.startsWith(base)) {
|
if (base == null || !n.startsWith(base)) {
|
||||||
try {
|
try {
|
||||||
Files.delete(packDir.resolve(n));
|
FileUtils.delete(packDir.resolve(n).toFile(),
|
||||||
|
FileUtils.RETRY | FileUtils.SKIP_MISSING);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error(e.getMessage(), e);
|
LOG.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue