-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add gh pr reopen <numberOrURL>
#857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| if pr.State == "MERGED" { | ||
| fmt.Fprintf(colorableErr(cmd), "%s Pull request #%d can't be reopened because it was already merged.\n", utils.Red("!"), pr.Number) | ||
| return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I think we should fail with a non-zero status every time we are unable to perform an operation, or (more precisely) if we are unable to reach the end-state that the user requested.
mislav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀🚀💫
|
|
||
| if pr.State == "MERGED" { | ||
| fmt.Fprintf(colorableErr(cmd), "%s Pull request #%d can't be reopened because it was already merged.\n", utils.Red("!"), pr.Number) | ||
| return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I think we should fail with a non-zero status every time we are unable to perform an operation, or (more precisely) if we are unable to reach the end-state that the user requested.
| return err | ||
| } | ||
|
|
||
| func PullRequestReopen(client *Client, repo ghrepo.Interface, pr PullRequest) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since other arguments to this function are pointers, perhaps we could accept a pointer to *PullRequest as well? With that we could avoid de-referencing *pr at call point
Relies on #854
Here is what it looks like
This command isn't as straight forward as that though because the PR could be merged. If it is we show the message below.
Closes #413