git-branches-dashboard: fix calculating changed flag when branch unmarked from favorites

GitOrigin-RevId: 305ba3ff926f1980d3b7b348dc84825db09b8da0
This commit is contained in:
Dmitry Zhuravlev
2019-12-25 17:32:33 +00:00
committed by intellij-monorepo-bot
parent 04f88f9d6b
commit 1bd586653a
@@ -69,12 +69,12 @@ internal class BranchesDashboardController(private val project: Project,
with(project.service<GitBranchManager>()) {
for (localBranch in localBranches) {
val isFavorite = localBranch.repositories.any { isFavorite(GitBranchType.LOCAL, it, localBranch.branchName) }
changed = changed or isFavorite
changed = changed or (localBranch.isFavorite != isFavorite)
localBranch.apply { this.isFavorite = isFavorite }
}
for (remoteBranch in remoteBranches) {
val isFavorite = remoteBranch.repositories.any { isFavorite(GitBranchType.REMOTE, it, remoteBranch.branchName) }
changed = changed or isFavorite
changed = changed or (remoteBranch.isFavorite != isFavorite)
remoteBranch.apply { this.isFavorite = isFavorite }
}
}