From 2af9d27628e1ede17e524d2902a7ee8a54c85f2b Mon Sep 17 00:00:00 2001 From: itsdalmo Date: Fri, 31 May 2019 16:36:49 +0800 Subject: [PATCH] Clean rebase output by using oneliner --- git.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/git.go b/git.go index d1284f4d..c3edbfe5 100644 --- a/git.go +++ b/git.go @@ -126,10 +126,7 @@ func (g *GitClient) Merge(sha string) error { // Rebase ... func (g *GitClient) Rebase(baseRef string, headSha string) error { - if err := g.command("git", "checkout", headSha).Run(); err != nil { - return fmt.Errorf("checkout failed: %s", err) - } - if err := g.command("git", "rebase", baseRef).Run(); err != nil { + if err := g.command("git", "rebase", baseRef, headSha).Run(); err != nil { return fmt.Errorf("rebase failed: %s", err) } return nil