Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-06-26 19:17:20 +0000
committerMichael Keppler2018-11-10 18:01:40 +0000
commit2e2810f7afd230a88ea5f3740401343814fd7e12 (patch)
tree11f6d9ab0c7e44240477006e001f91cd9408edd3
parentc7940ec94c58879eefe5e74d21e8621b09a438d6 (diff)
downloadegit-2e2810f7afd230a88ea5f3740401343814fd7e12.tar.gz
egit-2e2810f7afd230a88ea5f3740401343814fd7e12.tar.xz
egit-2e2810f7afd230a88ea5f3740401343814fd7e12.zip
Avoid identical entries in history view history
The egit history view implementation adapts the workbench selection when setting new input. The non egit history part creates a history dropdown from the inputs before they were adapted by egit. That is why the history dropdown can contain multiple similar entries, since they have been adapted to the same input by egit, but the general team API only sees the different (non adapted) inputs. We can fix this by returning the adapted input from egit to the general team API, so the comparison of inputs really removes the duplicates. Change-Id: Ie5139f83f7b75af76ed1c375cf139611a332329d Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Bug:536313
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java16
1 files changed, 14 insertions, 2 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 c0eb0bd524..c44a2e27b0 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
@@ -1805,7 +1805,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
GitTraceLocation.getTrace().traceEntry(
GitTraceLocation.HISTORYVIEW.getLocation(), useAsInput);
- if (useAsInput == getInput())
+ if (useAsInput == super.getInput())
return true;
this.input = null;
return super.setInput(useAsInput);
@@ -2174,6 +2174,18 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
return this.input;
}
+ /**
+ * The super implementation returns the raw input (e.g. the workbench
+ * selection). The Git History Page however adapts that input before
+ * actually using it. If we don't return this adapted input, then the
+ * history drop down will show the same (adapted) history input multiple
+ * times.
+ */
+ @Override
+ public Object getInput() {
+ return getInputInternal();
+ }
+
void setWarningTextInUIThread(final Job j) {
graph.getControl().getDisplay().asyncExec(new Runnable() {
@Override
@@ -2208,7 +2220,7 @@ public class GitHistoryPage extends HistoryPage implements RefsChangedListener,
GitTraceLocation.getTrace().trace(
GitTraceLocation.HISTORYVIEW.getLocation(),
"Setting input to table"); //$NON-NLS-1$
- final Object currentInput = getInput();
+ final Object currentInput = GitHistoryPage.super.getInput();
searchBar.setInput(new ICommitsProvider() {
@Override

Back to the top