Silence stderr in git push during pr create but show it on failures

This commit is contained in:
Mislav Marohnić 2019-12-04 16:16:10 +01:00
parent 5bfcab8ba1
commit 5d644d2468
2 changed files with 3 additions and 3 deletions

View file

@ -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")

View file

@ -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 {