Avoid re-wrapping of "could not determine suitable remote" error

This commit is contained in:
Mislav Marohnić 2019-11-14 19:31:33 +01:00
parent 237fd04ad0
commit 135efda6d3

View file

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