]> source.dussan.org Git - jgit.git/commitdiff
Do not create files to be updated before checkout of DirCache entry 28/2228/4
authorMatthias Sohn <matthias.sohn@sap.com>
Mon, 10 Jan 2011 22:09:34 +0000 (23:09 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 28 Jan 2011 00:11:12 +0000 (01:11 +0100)
DirCacheCheckout.checkoutEntry() prepares the new file content using a
temporary file and then renames it to the file to be written during
checkout. For files to be updated checkout() created each file before
calling checkoutEntry(). Hence renaming the temporary file always
failed which was corrected in exception handling by retrying to rename
the file after deleting the just newly created file.

Change-Id: I219f864f2ed8d68051d7b5955d0659964fa27274
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java

index dbd05117fddf14ba49ac17bba78d355ae945a580..8df583cc6a9825deebce500fe47d7079e13bb5ab 100644 (file)
@@ -422,7 +422,6 @@ public class DirCacheCheckout {
                        if (!file.getParentFile().mkdirs()) {
                                // ignore
                        }
-                       file.createNewFile();
                        DirCacheEntry entry = dc.getEntry(path);
                        checkoutEntry(repo, file, entry);
                }