diff options
author | Marc Strapetz <marc.strapetz@syntevo.com> | 2014-02-24 18:38:20 +0100 |
---|---|---|
committer | Robin Rosenberg <robin.rosenberg@dewire.com> | 2014-02-26 05:53:56 -0500 |
commit | 59a2dc801ce12b0522273e4403983d6ee4968c33 (patch) | |
tree | e39e6a230b630e5117045f070c59aaaea96bad26 /org.eclipse.jgit | |
parent | 8e0e78858c27b86cd0f04603e122fa69909c0299 (diff) | |
download | jgit-59a2dc801ce12b0522273e4403983d6ee4968c33.tar.gz jgit-59a2dc801ce12b0522273e4403983d6ee4968c33.zip |
Files should be deleted with "retry" option
Some of our Windows users have reported sporadic file system access
problems related to ObjectDirectory(Inserter) file deletion code in
combination with antiviral/firewall tools. For one of these users the
problem was fairly reproducible and changing deletion to RETRY solved
his problem.
Change-Id: I1e4001d5557fca693b7bac401268599467cb0c9e
Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java | 10 | ||||
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java index 434eadf5fa..882f5c8a45 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java @@ -557,11 +557,11 @@ public class ObjectDirectory extends FileObjectDatabase { // If the object is already in the repository, remove temporary file. // if (unpackedObjectCache.isUnpacked(id)) { - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); return InsertLooseObjectResult.EXISTS_LOOSE; } if (!createDuplicate && has(id)) { - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); return InsertLooseObjectResult.EXISTS_PACKED; } @@ -571,7 +571,7 @@ public class ObjectDirectory extends FileObjectDatabase { // that already exists. We can't be sure renameTo() would // fail on all platforms if dst exists, so we check first. // - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); return InsertLooseObjectResult.EXISTS_LOOSE; } if (tmp.renameTo(dst)) { @@ -592,7 +592,7 @@ public class ObjectDirectory extends FileObjectDatabase { } if (!createDuplicate && has(id)) { - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); return InsertLooseObjectResult.EXISTS_PACKED; } @@ -601,7 +601,7 @@ public class ObjectDirectory extends FileObjectDatabase { // either. We really don't know what went wrong, so // fail. // - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); return InsertLooseObjectResult.FAILURE; } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java index c55c60a208..c3e6ad9630 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectoryInserter.java @@ -182,7 +182,7 @@ class ObjectDirectoryInserter extends ObjectInserter { return tmp; } finally { if (delete) - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); } } @@ -211,7 +211,7 @@ class ObjectDirectoryInserter extends ObjectInserter { return tmp; } finally { if (delete) - FileUtils.delete(tmp); + FileUtils.delete(tmp, FileUtils.RETRY); } } |