Pre-select only tracked branch or matched by name in git pull dialog IDEA-242775

GitOrigin-RevId: 5e852722810c13f10f10b82eb48c94e8bc68eec5
This commit is contained in:
Daniil Tsaryov
2020-06-08 19:22:56 +03:00
committed by intellij-monorepo-bot
parent 467c0c7601
commit 2ca2dc8b8b
@@ -124,7 +124,12 @@ class GitPullDialog(private val project: Project,
val model = branchField.model as MutableCollectionComboBoxModel
model.update(branches)
model.selectedItem = branches.getOrElse(0) { "" }
val matchingBranch = repository.currentBranch?.findTrackedBranch(repository)?.nameForRemoteOperations
?: branches.find { branch -> branch == repository.currentBranchName }
?: ""
model.selectedItem = matchingBranch
}
private fun getRemoteBranches(repository: GitRepository, remote: GitRemote): List<String> {