mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[git] IJPL-203021 Fix current branch filtering condition
(cherry picked from commit 292319e954be5f377b33e4f2e1f7a705c6e96f5a) IJ-CR-173023 GitOrigin-RevId: fd05c4c301a36e4758cb05df2ee2672e86b96b08
This commit is contained in:
committed by
intellij-monorepo-bot
parent
45e789519f
commit
bbd6721d5f
@@ -65,8 +65,10 @@ private class GitCompareWithBranchesTreeModel(project: Project, repository: GitR
|
||||
override fun getLocalBranches(): Collection<GitStandardLocalBranch> = repository.state.localBranches.skipCurrentBranch()
|
||||
override fun getRecentBranches(): Collection<GitStandardLocalBranch> = super.getRecentBranches().skipCurrentBranch()
|
||||
|
||||
private fun Collection<GitStandardLocalBranch>.skipCurrentBranch(): Collection<GitStandardLocalBranch> =
|
||||
filter { repository.state.currentRef?.matches(it) == false }
|
||||
private fun Collection<GitStandardLocalBranch>.skipCurrentBranch(): Collection<GitStandardLocalBranch> {
|
||||
val currentBranch = repository.state.currentBranch ?: return this
|
||||
return filter { it != currentBranch }
|
||||
}
|
||||
|
||||
override fun getPreferredSelection(): TreePath? {
|
||||
return getPreferredBranch()?.let { createTreePathFor(this, it) }
|
||||
|
||||
Reference in New Issue
Block a user