]> source.dussan.org Git - jgit.git/commitdiff
Fix tests broken by fix for adding files in a network share 51/2351/2
authorRobin Rosenberg <robin.rosenberg@dewire.com>
Wed, 26 Jan 2011 19:30:30 +0000 (20:30 +0100)
committerChris Aniszczyk <caniszczyk@gmail.com>
Wed, 26 Jan 2011 19:52:58 +0000 (13:52 -0600)
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>
org.eclipse.jgit/src/org/eclipse/jgit/storage/file/ObjectDirectory.java

index ac48d2a4bc548ff66d3b2113ff4c66e855b1d365..021a91b6d81f1b6e2e94b494c246b645edb3ab56 100644 (file)
@@ -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;
                }