diff --git a/command/pr_create.go b/command/pr_create.go index 8f635e306..ec816658e 100644 --- a/command/pr_create.go +++ b/command/pr_create.go @@ -40,7 +40,7 @@ func prCreate(cmd *cobra.Command, _ []string) error { } if err = git.Push(remote, fmt.Sprintf("HEAD:%s", head)); err != nil { - return fmt.Errorf("was not able to push to remote '%s': %s", remote, err) + return err } title, err := cmd.Flags().GetString("title") diff --git a/git/git.go b/git/git.go index 2f8764241..4dff19ed2 100644 --- a/git/git.go +++ b/git/git.go @@ -109,8 +109,8 @@ func UncommittedChangeCount() (int, error) { } func Push(remote string, ref string) error { - cmd := GitCommand("push", "--set-upstream", remote, ref) - return cmd.Run() + pushCmd := GitCommand("push", "--set-upstream", remote, ref) + return utils.PrepareCmd(pushCmd).Run() } type BranchConfig struct {