[git] fix branches tree sync with model on tree show

GitOrigin-RevId: 569176158e98719ea41107161fc40d02060be0b7
This commit is contained in:
Ivan Semenov
2025-07-31 18:10:54 +00:00
committed by intellij-monorepo-bot
parent df7fa112c8
commit 0fc0b74dd2
@@ -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 {