mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
[gitlab] Automatically fill in title if there's only 1 commit
GitOrigin-RevId: d87ea6cfe5c0fdf04c0ceb8e6ce05e87acd38f8b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
49c202d03d
commit
e768016c4e
@@ -176,6 +176,20 @@ internal class GitLabMergeRequestCreateViewModelImpl(
|
||||
|
||||
_branchState.value = BranchState(baseRepo, baseBranch, baseRepo, currentBranch)
|
||||
}
|
||||
|
||||
cs.launch {
|
||||
combine(commits, branchState) { commitsResult, branchState ->
|
||||
val commits = commitsResult?.getOrNull()
|
||||
if (commits != null && commits.size == 1 && title.value.isEmpty()) {
|
||||
updateTitle(commits.first().subject.lines().firstOrNull() ?: return@combine)
|
||||
} else if (title.value.isEmpty()) {
|
||||
updateTitle(when (val branch = branchState?.headBranch ?: return@combine) {
|
||||
is GitRemoteBranch -> branch.nameForRemoteOperations
|
||||
else -> branch.name
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateTitle(text: String) {
|
||||
|
||||
Reference in New Issue
Block a user