From: Robin Rosenberg Date: Wed, 26 Jan 2011 19:30:30 +0000 (+0100) Subject: Fix tests broken by fix for adding files in a network share X-Git-Tag: v0.11.1~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F2351%2F2;p=jgit.git 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 --- 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; }