diff options
author | Glenn Vriesman <glenn.vriesman@gmail.com> | 2018-12-02 17:33:16 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-12-11 09:39:54 +1100 |
commit | 7a7e88577341f314ff54ef50474390f1f94d4b91 (patch) | |
tree | 482d36cddcdcb4b79e4b3473d481517e6a128d7f /pkg | |
parent | 34fd18a395eb3dde3f6a1894d6a30c16a27f5bda (diff) |
Added rebase support commands
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/git.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 2b5044971..bbd388303 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -269,6 +269,10 @@ func (c *GitCommand) RebaseBranch(onto string) error { return c.OSCommand.RunCommand(fmt.Sprintf("git rebase %s %s ", onto, curBranch)) } +func (c *GitCommand) ContinueRebaseBranch() error { + return c.OSCommand.RunCommand("git rebase --continue") +} + func (c *GitCommand) AbortRebaseBranch() error { return c.OSCommand.RunCommand("git rebase --abort") } @@ -450,6 +454,14 @@ func (c *GitCommand) IsInMergeState() (bool, error) { return strings.Contains(output, "conclude merge") || strings.Contains(output, "unmerged paths"), nil } +func (c *GitCommand) IsInRebaseState() (bool, error) { + output, err := c.OSCommand.RunCommandWithOutput("git status --untracked-files=all") + if err != nil { + return false, err + } + return strings.Contains(output, "rebase in progress"), nil +} + // RemoveFile directly func (c *GitCommand) RemoveFile(file *File) error { // if the file isn't tracked, we assume you want to delete it |