Skip to content

Commit 5534c3e

Browse files
authored
Merge pull request cli#1535 from royling/fix-pr-diff
Fix `gh pr diff` with hostname override
2 parents d8c5b7b + 0064263 commit 5534c3e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/queries_pr.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"net/http"
99
"strings"
1010

11-
"github.com/shurcooL/githubv4"
12-
11+
"github.com/cli/cli/internal/ghinstance"
1312
"github.com/cli/cli/internal/ghrepo"
13+
"github.com/shurcooL/githubv4"
1414
)
1515

1616
type PullRequestReviewState int
@@ -210,8 +210,8 @@ func (pr *PullRequest) ChecksStatus() (summary PullRequestChecksStatus) {
210210
}
211211

212212
func (c Client) PullRequestDiff(baseRepo ghrepo.Interface, prNumber int) (io.ReadCloser, error) {
213-
url := fmt.Sprintf("https://api.github.com/repos/%s/pulls/%d",
214-
ghrepo.FullName(baseRepo), prNumber)
213+
url := fmt.Sprintf("%srepos/%s/pulls/%d",
214+
ghinstance.RESTPrefix(baseRepo.RepoHost()), ghrepo.FullName(baseRepo), prNumber)
215215
req, err := http.NewRequest("GET", url, nil)
216216
if err != nil {
217217
return nil, err

0 commit comments

Comments
 (0)