diff --git a/plugins/git4idea/src/git4idea/ui/branch/popup/GitBranchesTreePopup.kt b/plugins/git4idea/src/git4idea/ui/branch/popup/GitBranchesTreePopup.kt index b6426e19ebf5..5e610c3a8d60 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/popup/GitBranchesTreePopup.kt +++ b/plugins/git4idea/src/git4idea/ui/branch/popup/GitBranchesTreePopup.kt @@ -187,7 +187,8 @@ class GitBranchesTreePopup(project: Project, step: GitBranchesTreePopupStep, par traverseNodesAndExpand() expandPreviouslyExpandedBranches() } - super.updateSpeedSearchColors(!haveBranches) + val model = tree.model + super.updateSpeedSearchColors(model.getChildCount(model.root) == 0) if (!pattern.isNullOrBlank()) { tree.emptyText.text = GitBundle.message("git.branches.popup.tree.no.branches", pattern) } diff --git a/plugins/git4idea/src/git4idea/ui/branch/tree/GitBranchesTreeMultiRepoModel.kt b/plugins/git4idea/src/git4idea/ui/branch/tree/GitBranchesTreeMultiRepoModel.kt index c7d84aa33608..b5986cd2b763 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/tree/GitBranchesTreeMultiRepoModel.kt +++ b/plugins/git4idea/src/git4idea/ui/branch/tree/GitBranchesTreeMultiRepoModel.kt @@ -61,7 +61,7 @@ class GitBranchesTreeMultiRepoModel( || (node === GitBranchType.REMOTE && commonRemoteBranchesTree.isEmpty()) private fun getChildren(parent: Any?): List { - if (parent == null || !haveFilteredBranches()) return emptyList() + if (parent == null) return emptyList() return when (parent) { TreeRoot -> getTopLevelNodes() is GitBranchType -> branchesTreeCache.getOrPut(parent) { getBranchTreeNodes(parent, emptyList()) } @@ -91,6 +91,4 @@ class GitBranchesTreeMultiRepoModel( private fun getPreferredBranch(): GitBranch? = getPreferredBranch(project, repositories, null, commonLocalBranchesTree, commonRemoteBranchesTree) - - private fun haveFilteredBranches(): Boolean = !commonLocalBranchesTree.isEmpty() || !commonRemoteBranchesTree.isEmpty() }