summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2011-01-26 20:30:30 +0100
committerChris Aniszczyk <caniszczyk@gmail.com>2011-01-26 13:52:58 -0600
commit24e7f0f6fa36d96986f63178fc239ec07d221b6b (patch)
tree3e8a6011bace10dfe2dc5f4db63165d53d0e49b8
parenta5b36ae1ea9d8be10fe72f8001bf246a7d4999eb (diff)
downloadjgit-24e7f0f6fa36d96986f63178fc239ec07d221b6b.tar.gz
jgit-24e7f0f6fa36d96986f63178fc239ec07d221b6b.zip
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
index ac48d2a4bc..021a91b6d8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java
@@ -482,7 +482,7 @@ public class ObjectDirectory extends FileObjectDatabase {
return InsertLooseObjectResult.EXISTS_LOOSE;
}
if (tmp.renameTo(dst)) {
- tmp.setReadOnly();
+ dst.setReadOnly();
unpackedObjectCache.add(id);
return InsertLooseObjectResult.INSERTED;
}
@@ -493,6 +493,7 @@ public class ObjectDirectory extends FileObjectDatabase {
//
dst.getParentFile().mkdir();
if (tmp.renameTo(dst)) {
+ dst.setReadOnly();
unpackedObjectCache.add(id);
return InsertLooseObjectResult.INSERTED;
}