mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] fix deep comparator keeping highlighting after branch filter unset
When branch filter is unset, cherri-picked commits should be un-highlighted. But when this happen during refresh, visible pack arrives with both new graph and new filters. So DeepComparator should check filters first.
This commit is contained in:
@@ -139,9 +139,14 @@ public class DeepComparator implements VcsLogHighlighter, Disposable {
|
||||
return;
|
||||
}
|
||||
|
||||
String comparedBranch = myTask.myComparedBranch;
|
||||
VcsLogBranchFilter branchFilter = dataPack.getFilters().getBranchFilter();
|
||||
if (branchFilter == null || !myTask.myComparedBranch.equals(VcsLogUtil.getSingleFilteredBranch(branchFilter, dataPack.getRefs()))) {
|
||||
stopAndUnhighlight();
|
||||
return;
|
||||
}
|
||||
|
||||
if (refreshHappened) {
|
||||
// collect data
|
||||
String comparedBranch = myTask.myComparedBranch;
|
||||
Map<GitRepository, GitBranch> repositoriesWithCurrentBranches = myTask.myRepositoriesWithCurrentBranches;
|
||||
VcsLogDataProvider provider = myTask.myProvider;
|
||||
|
||||
@@ -149,14 +154,12 @@ public class DeepComparator implements VcsLogHighlighter, Disposable {
|
||||
|
||||
// highlight again
|
||||
Map<GitRepository, GitBranch> repositories = getRepositories(dataPack.getLogProviders(), comparedBranch);
|
||||
if (repositories.equals(repositoriesWithCurrentBranches)) { // but not if current branch changed
|
||||
if (repositories.equals(repositoriesWithCurrentBranches)) {
|
||||
// but not if current branch changed
|
||||
highlightInBackground(comparedBranch, provider);
|
||||
}
|
||||
}
|
||||
else {
|
||||
VcsLogBranchFilter branchFilter = dataPack.getFilters().getBranchFilter();
|
||||
if (branchFilter == null || !myTask.myComparedBranch.equals(VcsLogUtil.getSingleFilteredBranch(branchFilter, dataPack.getRefs()))) {
|
||||
stopAndUnhighlight();
|
||||
else {
|
||||
removeHighlighting();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,6 +281,5 @@ public class DeepComparator implements VcsLogHighlighter, Disposable {
|
||||
handler.runInCurrentThread(null);
|
||||
return pickedCommits;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user