Skip to content

Commit

Permalink
🐛 Fix applying an amended commit
Browse files Browse the repository at this point in the history
When applying an amended commit, the validation routine considered no
changes in the tree as invalid. This condition occurs when only
changing the message and no files.
  • Loading branch information
mikelorant committed Feb 12, 2023
1 parent cdbcce6 commit c631518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (m Model) commit(q quit) Model {
}

func (m Model) validate() bool {
return m.state.Repository.Worktree.IsStaged() && m.models.header.Summary() != ""
return (m.state.Repository.Worktree.IsStaged() || m.amend) && m.models.header.Summary() != ""
}

func (m *Model) restoreModel(save savedState) {
Expand Down

0 comments on commit c631518

Please sign in to comment.