From 0fc0b74dd282905847c43770ade1453b711d9099 Mon Sep 17 00:00:00 2001 From: Ivan Semenov Date: Thu, 31 Jul 2025 18:47:45 +0200 Subject: [PATCH] [git] fix branches tree sync with model on tree show GitOrigin-RevId: 569176158e98719ea41107161fc40d02060be0b7 --- .../src/git4idea/ui/branch/dashboard/BranchesTree.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt b/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt index f367e5524b0a..036ee1759a3f 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt +++ b/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt @@ -243,10 +243,11 @@ internal class FilteringBranchesTree( // need EDT because of RA in TreeUtil.promiseVisit withContext(Dispatchers.EDT) { model.addListener(listener) - if (model.root.children.isNotEmpty() != (searchModel.root.childCount > 0)) { - updateTree() - } try { + val currentlyEmpty = searchModel.root.childCount > 0 + if (!currentlyEmpty || model.root.children.isNotEmpty()) { + updateTree() + } awaitCancellation() } finally {