Fixed message-only amend would not be allowed

This commit is contained in:
Abdelilah El Aissaoui 2022-10-15 18:11:01 +02:00
parent 3be15ddc0c
commit 38a1b60e91

View File

@ -10,7 +10,7 @@ class DoCommitUseCase @Inject constructor() {
suspend operator fun invoke(git: Git, message: String, amend: Boolean): RevCommit = withContext(Dispatchers.IO) {
git.commit()
.setMessage(message)
.setAllowEmpty(false)
.setAllowEmpty(amend) // Only allow empty commits when amending
.setAmend(amend)
.call()
}