Fix tests broken by fix for adding files in a network share

The change Ie0350e032a97e0d09626d6143c5c692873a5f6a2 was not
done properly. The renamed file was not write protected, and
this broke a test.

Bug: 335388
Change-Id: I41b2235b7677bc5fddc70dda2a56cdd2cb53ce5d
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
This commit is contained in:
Robin Rosenberg 2011-01-26 20:30:30 +01:00 committed by Chris Aniszczyk
parent a5b36ae1ea
commit 24e7f0f6fa
1 changed files with 2 additions and 1 deletions

View File

@ -482,7 +482,7 @@ InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
return InsertLooseObjectResult.EXISTS_LOOSE;
}
if (tmp.renameTo(dst)) {
tmp.setReadOnly();
dst.setReadOnly();
unpackedObjectCache.add(id);
return InsertLooseObjectResult.INSERTED;
}
@ -493,6 +493,7 @@ InsertLooseObjectResult insertUnpackedObject(File tmp, ObjectId id,
//
dst.getParentFile().mkdir();
if (tmp.renameTo(dst)) {
dst.setReadOnly();
unpackedObjectCache.add(id);
return InsertLooseObjectResult.INSERTED;
}