Skip to content

Commit aa70723

Browse files
Merge pull request #2558 from stefanhaller/allow-resetting-author-during-rebase
2 parents 7db54a9 + 2107222 commit aa70723

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pkg/commands/git_commands/rebase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (self *RebaseCommands) SetCommitAuthor(commits []*models.Commit, index int,
7979
}
8080

8181
func (self *RebaseCommands) GenericAmend(commits []*models.Commit, index int, f func() error) error {
82-
if index == 0 {
82+
if models.IsHeadCommit(commits, index) {
8383
// we've selected the top commit so no rebase is required
8484
return f()
8585
}

pkg/gui/controllers/local_commits_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,10 @@ func (self *LocalCommitsController) amendTo(commit *models.Commit) error {
474474
}
475475

476476
func (self *LocalCommitsController) amendAttribute(commit *models.Commit) error {
477+
if self.git.Status.WorkingTreeState() != enums.REBASE_MODE_NONE && !self.isHeadCommit() {
478+
return self.c.ErrorMsg(self.c.Tr.AlreadyRebasing)
479+
}
480+
477481
return self.c.Menu(types.CreateMenuOptions{
478482
Title: "Amend commit attribute",
479483
Items: []*types.MenuItem{

0 commit comments

Comments
 (0)