aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Goubet2013-05-13 10:34:24 (EDT)
committerLaurent Goubet2013-05-13 10:51:47 (EDT)
commit47ea039d0608ec694239ad1a0c661c6b6319bbe6 (patch)
tree9fc1e427f4570e8838d38fec08ed93dfff2aedf7
parent51438d9da015b53b85c0af00fd6e388aa4ff6ddf (diff)
downloadegit-47ea039d0608ec694239ad1a0c661c6b6319bbe6.zip
egit-47ea039d0608ec694239ad1a0c661c6b6319bbe6.tar.gz
egit-47ea039d0608ec694239ad1a0c661c6b6319bbe6.tar.bz2
NPE synchronizing remote branches with files not present in "left" siderefs/changes/57/12757/1
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/GitModelSynchronizeParticipant.java7
1 files changed, 6 insertions, 1 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 6e87a18..93056b5 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
@@ -49,6 +49,7 @@ import org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.internal.FileRevisionTypedElement;
+import org.eclipse.egit.ui.internal.GitCompareFileRevisionEditorInput;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.egit.ui.internal.synchronize.model.GitModelBlob;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -239,7 +240,11 @@ public class GitModelSynchronizeParticipant extends ModelSynchronizeParticipant
try {
final IFileRevision revision = ((GitResourceVariantTreeSubscriber) subscriber)
.getSourceFileRevision((IFile) resource);
- if (!(revision instanceof WorkspaceFileRevision)) {
+ if (revision == null) {
+ final ITypedElement newSource = new GitCompareFileRevisionEditorInput.EmptyTypedElement(
+ resource.getName());
+ ((ResourceDiffCompareInput) input).setLeft(newSource);
+ } else if (!(revision instanceof WorkspaceFileRevision)) {
final ITypedElement newSource = new FileRevisionTypedElement(
revision, getLocalEncoding(resource));
((ResourceDiffCompareInput) input).setLeft(newSource);