mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-15 11:56:37 +02:00
Merge pull request #2065 from jesseduffield/fix-rewording-merge-commit-with-editor
Fix rewording a merge commit with editor
This commit is contained in:
commit
95678b1b43
@ -227,11 +227,11 @@ func (self *LocalCommitsController) reword(commit *models.Commit) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
||||||
applied, err := self.handleMidRebaseCommand("reword", commit)
|
midRebase, err := self.handleMidRebaseCommand("reword", commit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if applied {
|
if midRebase {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,6 +240,11 @@ func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
|||||||
Prompt: self.c.Tr.RewordInEditorPrompt,
|
Prompt: self.c.Tr.RewordInEditorPrompt,
|
||||||
HandleConfirm: func() error {
|
HandleConfirm: func() error {
|
||||||
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
||||||
|
|
||||||
|
if self.context().GetSelectedLineIdx() == 0 {
|
||||||
|
return self.c.RunSubprocessAndRefresh(self.os.Cmd.New("git commit --allow-empty --amend --only"))
|
||||||
|
}
|
||||||
|
|
||||||
subProcess, err := self.git.Rebase.RewordCommitInEditor(
|
subProcess, err := self.git.Rebase.RewordCommitInEditor(
|
||||||
self.model.Commits, self.context().GetSelectedLineIdx(),
|
self.model.Commits, self.context().GetSelectedLineIdx(),
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user