Skip to content

Commit

Permalink
Fixed commit message disappear if pre-commit hook fails
Browse files Browse the repository at this point in the history
Fixes #248
  • Loading branch information
JetpackDuba committed Nov 2, 2024
1 parent db1467c commit 01b0827
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ fun UncommittedChanges(
val doCommit = {
statusViewModel.commit(commitMessage)
onStagedDiffEntrySelected(null)
setCommitMessage("")
}

val canCommit = commitMessage.isNotEmpty() && stageStateUi.hasStagedFiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ class StatusViewModel @Inject constructor(
val personIdent = getPersonIdent(git)

doCommitUseCase(git, commitMessage, amend, personIdent)

updateCommitMessage("")
_commitMessageChangesFlow.emit("")
_isAmend.value = false

positiveNotification(if (isAmend.value) "Commit amended" else "New commit created")
Expand Down

0 comments on commit 01b0827

Please sign in to comment.