summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2014-12-06 02:59:34 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2014-12-11 16:30:57 +0100
commit59c4ea042ca29b5ad6fee2e3c0761e22bdac440f (patch)
tree8c699a2bab02ee5386365805026842f76767ccc1 /org.eclipse.jgit
parent1b9130e8dbc5c5703ef5f03ade5106d83a105ba2 (diff)
downloadjgit-59c4ea042ca29b5ad6fee2e3c0761e22bdac440f.tar.gz
jgit-59c4ea042ca29b5ad6fee2e3c0761e22bdac440f.zip
Fix DirCacheCheckout to set correct file length if core.autocrlf=true
To update the file length stat we need to use the length of the temporary file since it's not yet renamed to the target file name here. The incorrect file length stat update was introduced in a606dc363d0f6b09e4527cca6b645d3cb1ec407d. Bug: 453962 Change-Id: I715c048227553efae6f8f6b6878c0f04f2609d9c Also-by: Konrad Kügler <swamblumat-eclipsebugs@yahoo.de> Also-by: Christian Halstrick <christian.halstrick@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
index c7dd03dd46..692cc8fb58 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
@@ -1245,9 +1245,9 @@ public class DirCacheCheckout {
} finally {
channel.close();
}
- entry.setLength(opt.getAutoCRLF() == AutoCRLF.TRUE
- ? f.length() // AutoCRLF wants on-disk-size
- : (int) ol.getSize());
+ entry.setLength(opt.getAutoCRLF() == AutoCRLF.TRUE ? //
+ tmpFile.length() // AutoCRLF wants on-disk-size
+ : (int) ol.getSize());
if (opt.isFileMode() && fs.supportsExecute()) {
if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) {