summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorilya.ivanov2011-01-28 16:37:12 (EST)
committer Chris Aniszczyk2011-01-31 10:13:15 (EST)
commit1c318867b526a7bab10e0e0220489b7c3414d3a0 (patch)
tree9af27e20877283ec7836c8bae25ca7d4b9358ffa
parenta733a44f0bce8c28c4a79e944fd23c09131cecb7 (diff)
downloadegit-1c318867b526a7bab10e0e0220489b7c3414d3a0.zip
egit-1c318867b526a7bab10e0e0220489b7c3414d3a0.tar.gz
egit-1c318867b526a7bab10e0e0220489b7c3414d3a0.tar.bz2
Allowing non-workspace resources to appear in sync viewrefs/changes/54/2354/5
Bug: 335560 Change-Id: I98416f1acb46fba226b9a42e772d849f27528f51 Signed-off-by: Ilya Ivanov <ilya.ivanov@intland.com> Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java15
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java3
2 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
index 9312963..ab39f4e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
@@ -58,11 +58,20 @@ public class GitAdapterFactory implements IAdapterFactory {
&& adapterType == IResource.class) {
GitModelObject obj = (GitModelObject) adaptableObject;
- if (obj instanceof GitModelBlob)
- return root.getFileForLocation(obj.getLocation());
+ if (obj instanceof GitModelBlob) {
+ IResource res = root.getFileForLocation(obj.getLocation());
+ if (res == null)
+ res = root.getFile(obj.getLocation());
+
+ return res;
+ }
if (obj instanceof GitModelTree) {
- return root.getContainerForLocation(obj.getLocation());
+ IResource res = root.getContainerForLocation(obj.getLocation());
+ if (res == null)
+ res = root.getFolder(obj.getLocation());
+
+ return res;
}
}
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java
index 5230c28..bda139b 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/synchronize/mapping/GitChangeSetContentProvider.java
@@ -116,4 +116,7 @@ public class GitChangeSetContentProvider extends SynchronizationContentProvider
super.refresh();
}
+ protected boolean isVisible(ISynchronizationContext context, Object object) {
+ return true;
+ }
}