diff options
| author | Laurent Goubet | 2013-04-18 07:16:24 +0000 |
|---|---|---|
| committer | Gerrit Code Review @ Eclipse.org | 2013-04-18 20:48:13 +0000 |
| commit | 12899be499945c01576f7da1df638d8d3a0f30f5 (patch) | |
| tree | 5e92a8548c1e9efb5e627baf6adbe77c0cddee5d | |
| parent | cc34f6558e6c90b67c88444a9c3ff39b94190ec3 (diff) | |
| download | egit-12899be499945c01576f7da1df638d8d3a0f30f5.tar.gz egit-12899be499945c01576f7da1df638d8d3a0f30f5.tar.xz egit-12899be499945c01576f7da1df638d8d3a0f30f5.zip | |
Local files should remain editable when synchronizing.
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.java | 10 |
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 26d8ea635f..6e87a186b3 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 |
