diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2013-12-26 01:22:04 +0100 |
---|---|---|
committer | Robin Stocker <robin@nibor.org> | 2014-02-02 13:16:19 +0100 |
commit | 5404e70dc64201786cd6a21efb41310912860122 (patch) | |
tree | bb3ac6ab7850c50f8a59e755578ca14b3a88e158 /org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java | |
parent | 8352d1729ca63d4d6d831b2da0b168c950bc6f52 (diff) | |
download | jgit-5404e70dc64201786cd6a21efb41310912860122.tar.gz jgit-5404e70dc64201786cd6a21efb41310912860122.zip |
Fix for core.autocrlf=input resulting in modified file
This version does not attempt to unsmudge, unlike the first attempt
in Idafad150553df14827eccfde2e3b95760e16a8b6.
Bug: 372834
Change-Id: I9300e735cb16d6208e1df963abb1ff69f688155d
Also-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Signed-off-by: Robin Stocker <robin@nibor.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java | 20 |
1 files changed, 14 insertions, 6 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 f8c8442ff8..40efc95f88 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java @@ -326,7 +326,8 @@ public class DirCacheCheckout { m.getEntryFileMode()); } else if (i.getDirCacheEntry() != null) { // The index contains a file (and not a folder) - if (f.isModified(i.getDirCacheEntry(), true) + if (f.isModified(i.getDirCacheEntry(), true, + this.walk.getObjectReader()) || i.getDirCacheEntry().getStage() != 0) // The working tree file is dirty or the index contains a // conflict @@ -660,7 +661,9 @@ public class DirCacheCheckout { break; case 0xFFD: // 12 13 14 if (equalIdAndMode(hId, hMode, iId, iMode)) - if (f == null || f.isModified(dce, true)) + if (f == null + || f.isModified(dce, true, + this.walk.getObjectReader())) conflict(name, dce, h, m); else remove(name); @@ -774,7 +777,8 @@ public class DirCacheCheckout { // Nothing in Head // Something in Index if (dce != null - && (f == null || f.isModified(dce, true))) + && (f == null || f.isModified(dce, true, + this.walk.getObjectReader()))) // No file or file is dirty // Nothing in Merge and current path is part of // File/Folder conflict @@ -841,7 +845,9 @@ public class DirCacheCheckout { // Something different from a submodule in Index // Nothing in Merge // Something in Head - if (f == null || f.isModified(dce, true)) + if (f == null + || f.isModified(dce, true, + this.walk.getObjectReader())) // file is dirty // Index contains the same as Head // Something different from a submodule in Index @@ -904,7 +910,8 @@ public class DirCacheCheckout { // file content update(name, mId, mMode); } else if (dce != null - && (f == null || f.isModified(dce, true))) { + && (f == null || f.isModified(dce, true, + this.walk.getObjectReader()))) { // File doesn't exist or is dirty // Head and Index don't contain a submodule // Head contains the same as Index. Merge differs @@ -1041,7 +1048,8 @@ public class DirCacheCheckout { wtIt = tw.getTree(1, WorkingTreeIterator.class); if (dcIt == null || wtIt == null) return true; - if (wtIt.isModified(dcIt.getDirCacheEntry(), true)) { + if (wtIt.isModified(dcIt.getDirCacheEntry(), true, + this.walk.getObjectReader())) { return true; } } |