From e63685705753177d0401a31be96873bd4b1bb177 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 6 Apr 2021 17:58:48 +1000 Subject: [PATCH] prevent adding staged files when renaming top commit --- pkg/commands/commits.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/commands/commits.go b/pkg/commands/commits.go index 4742ce448..74043518d 100644 --- a/pkg/commands/commits.go +++ b/pkg/commands/commits.go @@ -11,7 +11,7 @@ import ( // RenameCommit renames the topmost commit with the given name func (c *GitCommand) RenameCommit(name string) error { - return c.RunCommand("git commit --allow-empty --amend -m %s", c.OSCommand.Quote(name)) + return c.RunCommand("git commit --allow-empty --amend --only -m %s", c.OSCommand.Quote(name)) } // ResetToCommit reset to commit