aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Stocker2011-05-21 08:32:08 (EDT)
committerRobin Stocker2011-05-21 08:40:52 (EDT)
commit48fb40c507240672c4208f8b5734b48dec4aa0aa (patch)
tree586478b12864039dff554b5a52c8e21b85302139
parentf1949c2f8efc8ded4f843521c3f34696361d56a1 (diff)
downloadegit-48fb40c507240672c4208f8b5734b48dec4aa0aa.zip
egit-48fb40c507240672c4208f8b5734b48dec4aa0aa.tar.gz
egit-48fb40c507240672c4208f8b5734b48dec4aa0aa.tar.bz2
CompareTreeView: Fix encoding of right elementrefs/changes/90/3490/1
If the left element is an IFile, we use its encoding also for the right side. Bug: 345160 Change-Id: I721d0a6c27c32ca69b68e9771cf6d37443b9cf39 Signed-off-by: Robin Stocker <robin@nibor.org>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
index 04d6a8e..707af6b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CompareTreeView.java
@@ -250,14 +250,16 @@ public class CompareTreeView extends ViewPart {
};
GitFileRevision rightRevision = compareVersionMap.get(new Path(
repositoryMapping.getRepoRelativePath(res)));
- if (rightRevision == null)
+ if (rightRevision == null) {
right = new GitCompareFileRevisionEditorInput.EmptyTypedElement(
NLS
.bind(
UIText.CompareTreeView_ItemNotFoundInVersionMessage,
res.getName(), getCompareVersion()));
- else
- right = new FileRevisionTypedElement(rightRevision);
+ } else {
+ String encoding = CompareUtils.getResourceEncoding(res);
+ right = new FileRevisionTypedElement(rightRevision, encoding);
+ }
GitCompareFileRevisionEditorInput compareInput = new GitCompareFileRevisionEditorInput(
left, right, PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage());