mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 04:45:47 +02:00
Better error message for trying to squash or fixup the first commit
It's not so much the total number of commits that matters here, it's just whether we are on the first one. (This includes the other condition.) This allows us to get rid of the condition in rebase.go.
This commit is contained in:
parent
1c3db24e44
commit
dd61c49a15
11 changed files with 87 additions and 22 deletions
|
@ -178,10 +178,6 @@ func (self *RebaseCommands) BuildSingleActionTodo(commits []*models.Commit, acti
|
|||
|
||||
if action == "squash" || action == "fixup" {
|
||||
baseIndex++
|
||||
|
||||
if len(commits) <= baseIndex {
|
||||
return nil, "", errors.New(self.Tr.CannotSquashOntoSecondCommit)
|
||||
}
|
||||
}
|
||||
|
||||
todoLines := self.BuildTodoLines(commits[0:baseIndex], func(commit *models.Commit, i int) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue