Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2019-07-21 07:20:29 -0400
committerThomas Wolf2019-07-21 07:20:29 -0400
commit4869cd977ac253f65f61d360548b49dfec01b5db (patch)
tree012f50bd04c7e1019fefedf7cd97a7cce2eaf8be /org.eclipse.egit.ui/src/org/eclipse
parent572cc2f512eda3ac80e441fe24d7ae42d7eb22b3 (diff)
downloadegit-4869cd977ac253f65f61d360548b49dfec01b5db.tar.gz
egit-4869cd977ac253f65f61d360548b49dfec01b5db.tar.xz
egit-4869cd977ac253f65f61d360548b49dfec01b5db.zip
Fix CommitFileDiffViewer/"Show in History" for non-resources
The history page tried to get the RepositoryMapping from the path, but that doesn't work for non-resources. The history view would just show "No input". Use the alternative ResourceUtil.getRepository() instead. Change-Id: I2240b1c900a634fc57ad114b2759d3c72e804a46 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
index 3a9c6ec71..7f8820cd2 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
@@ -41,6 +41,7 @@ import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.egit.core.AdapterUtils;
+import org.eclipse.egit.core.internal.util.ResourceUtil;
import org.eclipse.egit.core.project.RepositoryMapping;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.JobFamilies;
@@ -1911,9 +1912,8 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
repo = input.getRepository();
} else if (o instanceof Path) {
Path path = (Path) o;
- RepositoryMapping mapping = RepositoryMapping.getMapping(path);
- if (mapping != null) {
- repo = mapping.getRepository();
+ repo = ResourceUtil.getRepository(path);
+ if (repo != null) {
input = new HistoryPageInput(repo,
new File[] { path.toFile() });
}

Back to the top