summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-06 17:58:48 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-06 19:34:32 +1000
commite63685705753177d0401a31be96873bd4b1bb177 (patch)
tree58efc9689bc9b91bce43d1d240b77c5ed0e2d762
parent1ae8523098daddb890af03d447d5c12bd08952c8 (diff)
prevent adding staged files when renaming top commit
-rw-r--r--pkg/commands/commits.go2
1 files changed, 1 insertions, 1 deletions
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