From 135efda6d325a1375d00a77b677eb56abfe5d69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Thu, 14 Nov 2019 19:31:33 +0100 Subject: [PATCH] Avoid re-wrapping of "could not determine suitable remote" error --- command/pr_create.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/pr_create.go b/command/pr_create.go index 7f1c4fcac..c8d86f53a 100644 --- a/command/pr_create.go +++ b/command/pr_create.go @@ -37,7 +37,7 @@ func prCreate(cmd *cobra.Command, _ []string) error { remote, err := guessRemote(ctx) if err != nil { - return errors.Wrap(err, "could not determine suitable remote") + return err } if err = git.Push(remote, fmt.Sprintf("HEAD:%s", head)); err != nil { @@ -179,7 +179,7 @@ func prCreate(cmd *cobra.Command, _ []string) error { func guessRemote(ctx context.Context) (string, error) { remotes, err := ctx.Remotes() if err != nil { - return "", errors.Wrap(err, "could not determine suitable remote") + return "", errors.Wrap(err, "could not read git remotes") } // TODO: consolidate logic with fsContext.BaseRepo