Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryWalk.java')
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryWalk.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryWalk.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryWalk.java
index 57ccd8e79f..18e541ef14 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryWalk.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryWalk.java
@@ -12,14 +12,15 @@ package org.eclipse.egit.ui.internal.history;
import java.io.IOException;
import java.text.MessageFormat;
+import java.util.Set;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.UIPreferences;
import org.eclipse.egit.ui.internal.UIText;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jgit.annotations.NonNull;
import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.errors.MissingObjectException;
-import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Ref;
@@ -38,13 +39,10 @@ class GitHistoryWalk extends SWTWalk {
private boolean initialized = false;
- private final AnyObjectId headId;
-
private final ObjectId toShow;
- GitHistoryWalk(Repository repository, AnyObjectId headId, ObjectId toShow) {
+ GitHistoryWalk(@NonNull Repository repository, ObjectId toShow) {
super(repository);
- this.headId = headId;
this.toShow = toShow;
}
@@ -73,12 +71,8 @@ class GitHistoryWalk extends SWTWalk {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
RefDatabase db = getRepository().getRefDatabase();
try {
- if (store.getBoolean(
- UIPreferences.RESOURCEHISTORY_SHOW_ALL_BRANCHES)) {
- markStartAllRefs(db, Constants.R_HEADS);
- markStartAllRefs(db, Constants.R_REMOTES);
- markStartAllRefs(db, Constants.R_TAGS);
- }
+ markStartAllRefs(new RefFilterHelper(getRepository())
+ .getMatchingRefsForSelectedRefFilters());
if (store.getBoolean(
UIPreferences.RESOURCEHISTORY_SHOW_ADDITIONAL_REFS)) {
markStartAdditionalRefs(db);
@@ -88,7 +82,6 @@ class GitHistoryWalk extends SWTWalk {
} else {
markUninteresting(db, Constants.R_NOTES);
}
- markStart(parseCommit(headId));
if (toShow != null) {
markStart(toShow);
}
@@ -111,6 +104,13 @@ class GitHistoryWalk extends SWTWalk {
}
}
+ private void markStartAllRefs(Set<Ref> refs)
+ throws IOException, IncorrectObjectTypeException {
+ for (Ref ref : refs) {
+ markStartRef(ref);
+ }
+ }
+
private void markStartAdditionalRefs(RefDatabase db)
throws IOException, IncorrectObjectTypeException {
for (Ref ref : db.getAdditionalRefs()) {

Back to the top