summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRobin Stocker2011-05-21 08:24:08 (EDT)
committer Robin Stocker2011-08-02 09:32:53 (EDT)
commit2c0033268db6462d096cd420c60ac4d8a590ffdc (patch)
treef7b932e475abe7833055226a397e09a02726431f
parentf2600be0293a3b502c5d2001e2341e586e7e258d (diff)
downloadegit-2c0033268db6462d096cd420c60ac4d8a590ffdc.zip
egit-2c0033268db6462d096cd420c60ac4d8a590ffdc.tar.gz
egit-2c0033268db6462d096cd420c60ac4d8a590ffdc.tar.bz2
CompareWithIndexAction: Fix encoding of index elementrefs/changes/89/3489/2
The encoding should be the same as the IFile in the workspace, to not get an incorrect diff. Bug: 345160 Change-Id: I2d81ef9c1b3b6187aafac00a0018bc2d48c1a5eb Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EditableRevision.java8
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java3
2 files changed, 10 insertions, 1 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EditableRevision.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EditableRevision.java
index 97d4807..b2bed95 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EditableRevision.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EditableRevision.java
@@ -114,6 +114,14 @@ public class EditableRevision extends FileRevisionTypedElement implements
super(fileRevision);
}
+ /**
+ * @param fileRevision
+ * @param encoding the file encoding
+ */
+ public EditableRevision(IFileRevision fileRevision, String encoding) {
+ super(fileRevision, encoding);
+ }
+
public boolean isEditable() {
return true;
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
index c59ce64..728e8e7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/CompareWithIndexActionHandler.java
@@ -107,7 +107,8 @@ public class CompareWithIndexActionHandler extends RepositoryActionHandler {
}
IFileRevision nextFile = GitFileRevision.inIndex(repository, gitPath);
- final EditableRevision next = new EditableRevision(nextFile);
+ String encoding = CompareUtils.getResourceEncoding(baseFile);
+ final EditableRevision next = new EditableRevision(nextFile, encoding);
IContentChangeListener listener = new IContentChangeListener() {
public void contentChanged(IContentChangeNotifier source) {