summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRobin Stocker2011-08-18 03:41:24 (EDT)
committer Stefan Lay2011-08-18 03:41:24 (EDT)
commit73aaf16642824de8ceabe004e365859851251c63 (patch)
tree3cd4a5d4bd01c461d40f786f81fe33cf0900faa3
parent26b6ed6b391988e66f172301c38e1d0e33281a66 (diff)
downloadegit-73aaf16642824de8ceabe004e365859851251c63.zip
egit-73aaf16642824de8ceabe004e365859851251c63.tar.gz
egit-73aaf16642824de8ceabe004e365859851251c63.tar.bz2
Use resource encoding in getFileCachedRevisionTypedElementrefs/changes/48/3948/2
This fixes problems in compare actions that use index as base (Compare index with HEAD, Staging View and Synchronize View). When the workspace encoding is different from the encoding of the resource, the index side of the diff would be decoded incorrectly (while the other side would be decoded correctly), leading to spurious diffs. Bug: 345160 Change-Id: If84334131ad53732aeac595e43ac0972de359628 Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
index 018e9a9..3f68f81 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
@@ -320,7 +320,9 @@ public class CompareUtils {
// check if file is staged
if (entry != null) {
- return new FileRevisionTypedElement(GitFileRevision.inIndex(db, gitPath));
+ GitFileRevision nextFile = GitFileRevision.inIndex(db, gitPath);
+ String encoding = CompareCoreUtils.getResourceEncoding(db, gitPath);
+ return new FileRevisionTypedElement(nextFile, encoding);
}
} catch (IOException e) {
Activator.error(NLS.bind(UIText.GitHistoryPage_errorLookingUpPath,