|
|
|
|
|
|
|
|
return InsertLooseObjectResult.EXISTS_PACKED; |
|
|
return InsertLooseObjectResult.EXISTS_PACKED; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
tmp.setReadOnly(); |
|
|
|
|
|
|
|
|
|
|
|
final File dst = fileFor(id); |
|
|
final File dst = fileFor(id); |
|
|
if (dst.exists()) { |
|
|
if (dst.exists()) { |
|
|
// We want to be extra careful and avoid replacing an object |
|
|
// We want to be extra careful and avoid replacing an object |
|
|
|
|
|
|
|
|
return InsertLooseObjectResult.EXISTS_LOOSE; |
|
|
return InsertLooseObjectResult.EXISTS_LOOSE; |
|
|
} |
|
|
} |
|
|
if (tmp.renameTo(dst)) { |
|
|
if (tmp.renameTo(dst)) { |
|
|
|
|
|
tmp.setReadOnly(); |
|
|
unpackedObjectCache.add(id); |
|
|
unpackedObjectCache.add(id); |
|
|
return InsertLooseObjectResult.INSERTED; |
|
|
return InsertLooseObjectResult.INSERTED; |
|
|
} |
|
|
} |