Add better gh pr view message
This commit is contained in:
parent
5296f72189
commit
9b40efcad5
2 changed files with 9 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue