aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Goubet2013-04-18 03:16:24 (EDT)
committerGerrit Code Review @ Eclipse.org2013-04-18 16:48:13 (EDT)
commit12899be499945c01576f7da1df638d8d3a0f30f5 (patch)
tree5e92a8548c1e9efb5e627baf6adbe77c0cddee5d
parentcc34f6558e6c90b67c88444a9c3ff39b94190ec3 (diff)
downloadegit-12899be499945c01576f7da1df638d8d3a0f30f5.zip
egit-12899be499945c01576f7da1df638d8d3a0f30f5.tar.gz
egit-12899be499945c01576f7da1df638d8d3a0f30f5.tar.bz2
Local files should remain editable when synchronizing.refs/changes/03/12003/2
We can't wrap WorkspaceFileRevisions within FileRevisionTypedElements since those are not editable. Bug: 403363 Change-Id: I2a18495e349b64128166a39533fda8b02109d4dd
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java
index 26d8ea6..6e87a18 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java
@@ -38,6 +38,7 @@ import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.egit.core.AdapterUtils;
+import org.eclipse.egit.core.internal.storage.WorkspaceFileRevision;
import org.eclipse.egit.core.project.GitProjectData;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.core.synchronize.GitResourceVariantTreeSubscriber;
@@ -238,10 +239,11 @@ public class GitModelSynchronizeParticipant extends ModelSynchronizeParticipant
try {
final IFileRevision revision = ((GitResourceVariantTreeSubscriber) subscriber)
.getSourceFileRevision((IFile) resource);
- final ITypedElement newSource = new FileRevisionTypedElement(
- revision,
- getLocalEncoding(resource));
- ((ResourceDiffCompareInput) input).setLeft(newSource);
+ if (!(revision instanceof WorkspaceFileRevision)) {
+ final ITypedElement newSource = new FileRevisionTypedElement(
+ revision, getLocalEncoding(resource));
+ ((ResourceDiffCompareInput) input).setLeft(newSource);
+ }
} catch (TeamException e) {
// Keep the input from super as-is
String error = NLS