diff options
author | Thomas Wolf | 2020-07-24 09:35:29 +0000 |
---|---|---|
committer | Thomas Wolf | 2020-08-19 09:12:38 +0000 |
commit | 2ae6ad5a728c6b5d97773e9ce2ab4564aa6f791c (patch) | |
tree | ee47ce5d0b30a57267264994e62b86efbe5eac74 | |
parent | 711fbd3b472b3e6fc87935234c2a9a90635a85c9 (diff) | |
download | egit-2ae6ad5a728c6b5d97773e9ce2ab4564aa6f791c.tar.gz egit-2ae6ad5a728c6b5d97773e9ce2ab4564aa6f791c.tar.xz egit-2ae6ad5a728c6b5d97773e9ce2ab4564aa6f791c.zip |
Fix comparisons with text files committed with CR/LF for text=auto
Git never converts line endings for such files; neither on check-in
nor on check out. Adapt to new API from JGit to deal with this.
Bug: 565048
JGit-Dependency: If1282ef43e2abd00263541bd10a01fe1f5c619fc
Change-Id: I12eba23c1bacb2c81a5dbffa3afded3eea5da7ef
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r-- | org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java index 3b2525a7ce..22c06bee07 100644 --- a/org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java +++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/storage/GitBlobStorage.java @@ -3,7 +3,7 @@ * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> * Copyright (C) 2011, Dariusz Luksza <dariusz@luksza.org> * Copyright (C) 2014, Obeo - * Copyright (C) 2017, Thomas Wolf <thomas.wolf@paranor.ch> + * Copyright (C) 2017, 2020 Thomas Wolf <thomas.wolf@paranor.ch> * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -150,7 +150,6 @@ public class GitBlobStorage implements IEncodedStorage { return new ByteArrayInputStream(Constants.encode(blobId.name())); } try { - WorkingTreeOptions workingTreeOptions = db.getConfig().get(WorkingTreeOptions.KEY); InputStream objectInputStream = db.open(blobId, Constants.OBJ_BLOB).openStream(); InputStream filteredInputStream = objectInputStream; @@ -161,13 +160,14 @@ public class GitBlobStorage implements IEncodedStorage { EolStreamType streamType; if (metadata != null && metadata.eolStreamType != null) { streamType = metadata.eolStreamType; - } else if (workingTreeOptions.getAutoCRLF() == AutoCRLF.TRUE) { + } else if (db.getConfig().get(WorkingTreeOptions.KEY) + .getAutoCRLF() == AutoCRLF.TRUE) { streamType = EolStreamType.AUTO_CRLF; } else { streamType = EolStreamType.DIRECT; } return EolStreamTypeUtil.wrapInputStream(filteredInputStream, - streamType); + streamType, true); } catch (MissingObjectException notFound) { throw new CoreException(Activator.error(NLS.bind( CoreText.BlobStorage_blobNotFound, blobId.name(), path), |