Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-09-11 15:55:53 -0400
committerMatthias Sohn2019-09-12 06:02:11 -0400
commit2e75fe6be19cd2551f29f1bb0e0175b15319984d (patch)
tree4960da92dd3a130a91a2652f138a49d87f27e6e1
parent0bfba111864decd02c324e5c80c77870b2724db6 (diff)
downloadjgit-master.tar.gz
jgit-master.tar.xz
jgit-master.zip
Remove an old work-around for core.autocrlf = inputHEADmaster
The removed code was trying to avoid mistakenly reporting differences when core.autocrlf was set to "input" but a file had already been committed with CR-LF. It did that by running the blob from the cache through a CRLF-to-LF filter because older JGit would also run the file from the working tree through such a filter. The real fix for this case was done in commit 60cf85a. Since then files are not normalized if they have already been committed with CR-LF and this old fix attempt from bug 372834 is no longer needed. Change-Id: Ib4facc153d81325cb48b4ee956a596b423f36241 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java38
1 files changed, 2 insertions, 36 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
index 7424c13e2c..2dd127bc2f 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/WorkingTreeIterator.java
@@ -101,7 +101,6 @@ import org.eclipse.jgit.util.Paths;
import org.eclipse.jgit.util.RawParseUtils;
import org.eclipse.jgit.util.TemporaryBuffer;
import org.eclipse.jgit.util.TemporaryBuffer.LocalFile;
-import org.eclipse.jgit.util.io.AutoLFInputStream;
import org.eclipse.jgit.util.io.EolStreamTypeUtil;
import org.eclipse.jgit.util.sha1.SHA1;
@@ -1097,41 +1096,8 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator {
return !new File(readSymlinkTarget(current())).equals(
new File(readContentAsNormalizedString(entry, reader)));
}
- // Content differs: that's a real change, perhaps
- if (reader == null) // deprecated use, do no further checks
- return true;
-
- switch (getEolStreamType()) {
- case DIRECT:
- return true;
- default:
- try {
- ObjectLoader loader = reader.open(entry.getObjectId());
- if (loader == null)
- return true;
-
- // We need to compute the length, but only if it is not
- // a binary stream.
- long dcInLen;
- try (InputStream dcIn = new AutoLFInputStream(
- loader.openStream(), true,
- true /* abort if binary */)) {
- dcInLen = computeLength(dcIn);
- } catch (AutoLFInputStream.IsBinaryException e) {
- return true;
- }
-
- try (InputStream dcIn = new AutoLFInputStream(
- loader.openStream(), true)) {
- byte[] autoCrLfHash = computeHash(dcIn, dcInLen);
- boolean changed = getEntryObjectId()
- .compareTo(autoCrLfHash, 0) != 0;
- return changed;
- }
- } catch (IOException e) {
- return true;
- }
- }
+ // Content differs: that's a real change
+ return true;
}
}

Back to the top