Take in a pointer
This commit is contained in:
parent
1e88226b2b
commit
5cc60c669e
2 changed files with 5 additions and 5 deletions
|
|
@ -761,7 +761,7 @@ loop:
|
|||
return &res, nil
|
||||
}
|
||||
|
||||
func PullRequestClose(client *Client, repo ghrepo.Interface, pr PullRequest) error {
|
||||
func PullRequestClose(client *Client, repo ghrepo.Interface, pr *PullRequest) error {
|
||||
var mutation struct {
|
||||
ClosePullRequest struct {
|
||||
PullRequest struct {
|
||||
|
|
@ -780,7 +780,7 @@ func PullRequestClose(client *Client, repo ghrepo.Interface, pr PullRequest) err
|
|||
return err
|
||||
}
|
||||
|
||||
func PullRequestReopen(client *Client, repo ghrepo.Interface, pr PullRequest) error {
|
||||
func PullRequestReopen(client *Client, repo ghrepo.Interface, pr *PullRequest) error {
|
||||
var mutation struct {
|
||||
ReopenPullRequest struct {
|
||||
PullRequest struct {
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ func prClose(cmd *cobra.Command, args []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
err = api.PullRequestClose(apiClient, baseRepo, *pr)
|
||||
err = api.PullRequestClose(apiClient, baseRepo, pr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("API call failed: %w", err)
|
||||
}
|
||||
|
|
@ -395,7 +395,7 @@ func prReopen(cmd *cobra.Command, args []string) error {
|
|||
}
|
||||
|
||||
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)
|
||||
fmt.Fprintf(colorableErr(cmd), "%s Pull request #%d can't be reopened because it was already merged\n", utils.Red("!"), pr.Number)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -404,7 +404,7 @@ func prReopen(cmd *cobra.Command, args []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
err = api.PullRequestReopen(apiClient, baseRepo, *pr)
|
||||
err = api.PullRequestReopen(apiClient, baseRepo, pr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("API call failed: %w", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue