Add gh pr reopen <numberOrURL> - #857
Merged
Merged
Conversation
probablycorey
commented
May 1, 2020
|
|
||
| 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 |
Contributor
Author
Contributor
There was a problem hiding this comment.
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.
probablycorey
marked this pull request as ready for review
May 1, 2020 21:18
mislav
approved these changes
May 4, 2020
|
|
||
| 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 |
Contributor
There was a problem hiding this comment.
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 { |
Contributor
There was a problem hiding this comment.
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
billygriffin
reviewed
May 4, 2020
billygriffin
reviewed
May 4, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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