summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRobin Stocker2011-11-21 09:21:23 (EST)
committer Matthias Sohn2011-12-01 17:22:23 (EST)
commit733368509e0e5112408ecdff8378b6bac897d24f (patch)
treea6c5a7eba0184d876c8dec1aa1a5f092b3ef13cb
parent08ecea67447d9ff5824108e9ee854625d297b037 (diff)
downloadegit-733368509e0e5112408ecdff8378b6bac897d24f.zip
egit-733368509e0e5112408ecdff8378b6bac897d24f.tar.gz
egit-733368509e0e5112408ecdff8378b6bac897d24f.tar.bz2
Pass file encoding to EditableRevision in FileEditableRevisionrefs/changes/56/4656/2
Previously, the encoding was not specified. This could lead to spurious diffs when the default workspace encoding is different from the file encoding (e.g. for XML files), because the left and right sides were decoded differently. An example of where this occurred was the Merge Tool with the HEAD version as left input. This this change, the problem-causing constructor of EditableRevision without encoding argument can be deleted, as this was the last code using it. Bug: 345160 Change-Id: I88f8bd62a122b3d7c7cc39c5d7242462cdec4038 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/EditableRevision.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileEditableRevision.java3
2 files changed, 2 insertions, 8 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 be2a090..1f7ed55 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
@@ -110,13 +110,6 @@ public class EditableRevision extends FileRevisionTypedElement implements
/**
* @param fileRevision
- */
- public EditableRevision(IFileRevision fileRevision) {
- super(fileRevision);
- }
-
- /**
- * @param fileRevision
* @param encoding the file encoding
*/
public EditableRevision(IFileRevision fileRevision, String encoding) {
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileEditableRevision.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileEditableRevision.java
index 5246ad1..8e450d7 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileEditableRevision.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/FileEditableRevision.java
@@ -15,6 +15,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.egit.core.internal.CompareCoreUtils;
import org.eclipse.egit.ui.Activator;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress;
@@ -40,7 +41,7 @@ public class FileEditableRevision extends EditableRevision {
*/
public FileEditableRevision(IFileRevision fileRevision, IFile file,
IRunnableContext runnableContext) {
- super(fileRevision);
+ super(fileRevision, CompareCoreUtils.getResourceEncoding(file));
this.file = file;
Assert.isNotNull(runnableContext);
this.runnableContext = runnableContext;