-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Modify GetBranch to handle redirects #1901
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1901 +/- ##
==========================================
+ Coverage 97.65% 97.83% +0.18%
==========================================
Files 105 105
Lines 6786 6803 +17
==========================================
+ Hits 6627 6656 +29
+ Misses 86 80 -6
+ Partials 73 67 -6
Continue to review full report at Codecov.
|
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.
Please add the missing line and also add a test that runs through the code with a redirect.
See https://github.com/google/go-github/blob/master/github/repos_contents_test.go#L668-L693 for inspiration.
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.
Very nice, @n1lesh ! Thank you!
LGTM.
Awaiting second LGTM before merging.
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.
LGTM.
go-github released the Go client library to [38.1.0][1] recently. API changes includes: * Add ListOptions required by GetCommit method. As described in change[2] * Add followRedirects required by GetBranch method and set it to false as start point. As described in change[3] [1]: https://github.com/google/go-github/releases/tag/v38.1.0 [2]: google/go-github#1960 [3]: google/go-github#1901
go-github released the Go client library to [38.1.0][1] recently. API changes includes: * Add ListOptions required by GetCommit method. As described in change[2] * Add followRedirects required by GetBranch method and set it to false as start point. As described in change[3] [1]: https://github.com/google/go-github/releases/tag/v38.1.0 [2]: google/go-github#1960 [3]: google/go-github#1901
go-github released the Go client library to [38.1.0][1] recently. API changes includes: * Add ListOptions required by GetCommit method. As described in change[2] * Add followRedirects required by GetBranch method and set it to false as start point. As described in change[3] [1]: https://github.com/google/go-github/releases/tag/v38.1.0 [2]: google/go-github#1960 [3]: google/go-github#1901
Adds a new followRedirects param for handling redirects on the GetBranch API. If redirected, the
response.Request.URL
will contain the redirected URL.As per: #1895.