summaryrefslogtreecommitdiffstats
path: root/pkg/commands/commits.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-05 21:08:33 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-06 19:34:32 +1000
commit5ce9e0193a47692d38a2b2aa549630458ccf3038 (patch)
tree205d9730e521e566123669035bc0c05e536ad1dd /pkg/commands/commits.go
parent4c71c26593e76e34bafcb7df717e53204b522da5 (diff)
add retry logic for running git commands to avoid index.lock problems
Diffstat (limited to 'pkg/commands/commits.go')
-rw-r--r--pkg/commands/commits.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/pkg/commands/commits.go b/pkg/commands/commits.go
index 27005ebec..4742ce448 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.OSCommand.RunCommand("git commit --allow-empty --amend -m %s", c.OSCommand.Quote(name))
+ return c.RunCommand("git commit --allow-empty --amend -m %s", c.OSCommand.Quote(name))
}
// ResetToCommit reset to commit
@@ -74,7 +74,7 @@ func (c *GitCommand) ShowCmdStr(sha string, filterPath string) string {
// Revert reverts the selected commit by sha
func (c *GitCommand) Revert(sha string) error {
- return c.OSCommand.RunCommand("git revert %s", sha)
+ return c.RunCommand("git revert %s", sha)
}
// CherryPickCommits begins an interactive rebase with the given shas being cherry picked onto HEAD
@@ -94,5 +94,5 @@ func (c *GitCommand) CherryPickCommits(commits []*models.Commit) error {
// CreateFixupCommit creates a commit that fixes up a previous commit
func (c *GitCommand) CreateFixupCommit(sha string) error {
- return c.OSCommand.RunCommand("git commit --fixup=%s", sha)
+ return c.RunCommand("git commit --fixup=%s", sha)
}