Add better gh pr view message

This commit is contained in:
Corey Johnson 2019-12-10 15:53:29 -08:00
parent 5296f72189
commit 9b40efcad5
2 changed files with 9 additions and 1 deletions

View file

@ -368,7 +368,7 @@ func PullRequestForBranch(client *Client, ghRepo Repo, branch string) (*PullRequ
}
}
return nil, fmt.Errorf("no open pull requests found for branch %q", branch)
return nil, nil
}
func CreatePullRequest(client *Client, ghRepo Repo, params map[string]interface{}) (*PullRequest, error) {

View file

@ -271,6 +271,14 @@ func prView(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
if pr == nil {
branch, err := ctx.Branch()
if err != nil {
return err
}
return fmt.Errorf("no open pull requests found for branch %q. To open a specific PR use a PR number as an argument", branch)
}
openURL = pr.URL
}
}