mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Allow rewording the head commit during interactive rebase
This commit is contained in:
@ -229,7 +229,7 @@ func (self *LocalCommitsController) reword(commit *models.Commit) error {
|
||||
func (self *LocalCommitsController) doRewordEditor() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.RewordCommit)
|
||||
|
||||
if self.context().GetSelectedLineIdx() == 0 {
|
||||
if self.isHeadCommit() {
|
||||
return self.c.RunSubprocessAndRefresh(self.os.Cmd.New("git commit --allow-empty --amend --only"))
|
||||
}
|
||||
|
||||
@ -728,3 +728,7 @@ func (self *LocalCommitsController) context() *context.LocalCommitsContext {
|
||||
func (self *LocalCommitsController) paste() error {
|
||||
return self.helpers.CherryPick.Paste()
|
||||
}
|
||||
|
||||
func (self *LocalCommitsController) isHeadCommit() bool {
|
||||
return models.IsHeadCommit(self.model.Commits, self.context().GetSelectedLineIdx())
|
||||
}
|
||||
|
Reference in New Issue
Block a user