Skip to content

Commit

Permalink
Added rebase support commands
Browse files Browse the repository at this point in the history
  • Loading branch information
glvr182 authored and jesseduffield committed Dec 10, 2018
1 parent 34fd18a commit 7a7e885
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/commands/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7a7e885

Please sign in to comment.