Clear the preserved commit message on the UI thread

The commit's gpg onSuccess runs on a worker when the command output is
streamed, so its ClearPreservedCommitMessage wrote commit-message
context state off the UI thread. Bounce that write through OnUIThread.
This commit is contained in:
Stefan Haller 2026-07-07 10:20:14 +02:00
parent 12757e2723
commit fefb3b632e

View file

@ -149,7 +149,12 @@ func (self *WorkingTreeHelper) handleCommit(summary string, description string,
self.c.LogAction(self.c.Tr.Actions.Commit)
return self.gpgHelper.WithGpgHandlingAndSelectHeadCommit(cmdObj, git_commands.CommitGpgSign, self.c.Tr.CommittingStatus,
func() error {
self.commitsHelper.ClearPreservedCommitMessage()
// This runs on a worker when the commit output is streamed, so
// bounce the preserved-message write to the UI thread.
self.c.OnUIThread(func() error {
self.commitsHelper.ClearPreservedCommitMessage()
return nil
})
return nil
})
}