Merge "Files should be deleted with "retry" option"
This commit is contained in:
commit
a6828b9b73
|
@ -557,11 +557,11 @@ InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
|
|||
// 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 @@ InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
|
|||
// 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 @@ InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
|
|||
}
|
||||
|
||||
if (!createDuplicate && has(id)) {
|
||||
FileUtils.delete(tmp);
|
||||
FileUtils.delete(tmp, FileUtils.RETRY);
|
||||
return InsertLooseObjectResult.EXISTS_PACKED;
|
||||
}
|
||||
|
||||
|
@ -601,7 +601,7 @@ InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
|
|||
// either. We really don't know what went wrong, so
|
||||
// fail.
|
||||
//
|
||||
FileUtils.delete(tmp);
|
||||
FileUtils.delete(tmp, FileUtils.RETRY);
|
||||
return InsertLooseObjectResult.FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ private File toTemp(final MessageDigest md, final int type, long len,
|
|||
return tmp;
|
||||
} finally {
|
||||
if (delete)
|
||||
FileUtils.delete(tmp);
|
||||
FileUtils.delete(tmp, FileUtils.RETRY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -211,7 +211,7 @@ private File toTemp(final int type, final byte[] buf, final int pos,
|
|||
return tmp;
|
||||
} finally {
|
||||
if (delete)
|
||||
FileUtils.delete(tmp);
|
||||
FileUtils.delete(tmp, FileUtils.RETRY);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue