mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-10 23:57:43 +02:00
Extract helper function doRewordEditor
No behavior change, just a preparation for the next commit.
This commit is contained in:
parent
48df9b7f4e
commit
b8d33b8f7b
@ -226,19 +226,7 @@ func (self *LocalCommitsController) reword(commit *models.Commit) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
func (self *LocalCommitsController) doRewordEditor() error {
|
||||||
midRebase, err := self.handleMidRebaseCommand("reword", commit)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if midRebase {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return self.c.Confirm(types.ConfirmOpts{
|
|
||||||
Title: self.c.Tr.RewordInEditorTitle,
|
|
||||||
Prompt: self.c.Tr.RewordInEditorPrompt,
|
|
||||||
HandleConfirm: func() error {
|
|
||||||
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
||||||
|
|
||||||
if self.context().GetSelectedLineIdx() == 0 {
|
if self.context().GetSelectedLineIdx() == 0 {
|
||||||
@ -256,7 +244,21 @@ func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
}
|
||||||
|
|
||||||
|
func (self *LocalCommitsController) rewordEditor(commit *models.Commit) error {
|
||||||
|
midRebase, err := self.handleMidRebaseCommand("reword", commit)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if midRebase {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return self.c.Confirm(types.ConfirmOpts{
|
||||||
|
Title: self.c.Tr.RewordInEditorTitle,
|
||||||
|
Prompt: self.c.Tr.RewordInEditorPrompt,
|
||||||
|
HandleConfirm: self.doRewordEditor,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user