All available calls in the `go-github` package close the `resp.Body` before returning.
Because the `GetArchiveLink` method doesn’t use the [`Do`](https://github.com/google/go-github/blob/master/github/github.go#L381) method, we have to make sure the body is closed here as well.
Closes#485.
Change-Id: Iec0d88cf66d4d658fcd6aec374b4bc2358269a09
This field is unused. There is no "commit message" inside of
RepositoryCommit (higher level GitHub object), it's only inside of
Commit (lower level git object).
It was added accidentally in #49 and not caught via test due to #491.
Followup to #49. See https://github.com/google/go-github/pull/49/files#r92034462.
Previously, the test would pass if got and want were different, and
fail if they were equal.
Closes#491.
Change-Id: Ie9b0059595ef85777613578b06c98c10104f4e6a
Add blank lines to keep paragraphs separate.
Without a blank line, all sentences get merged into a single paragraph, which would make this less readable.
Adjust language to be more specific to go-github's methods.
Shorten it by removing some unneeded phrases like "if you would like to".
Refer to methods in go-github rather than endpoints, and be more specific about actions.
This is done to try to make it more readable and clear.
Fixes#477.
Closes#489.
Change-Id: I9e9171d0a77a1c029c804cbd50fb2e194b1c2a1d
Per
<https://developer.github.com/changes/2016-06-27-protected-branches-api-update/>,
breaking changes were made to the protected branches API during the preview
period.
* Removes Branch.Protection
* Removes EditBranch, protection is now modified using separate API routes
* Adds GetBranchProtection
* Adds UpdateBranchProtection
* Adds RemoveBranchProtection
`omitempty` is intentionally left off fields in `ProtectionRequest` because
passing `nil` (JSON `null`) has semantic meaning (described in
<https://developer.github.com/v3/repos/branches/#update-branch-protection>)
Fixes#387.
Closes#476.
Change-Id: I674e1d3a486e80ce241e2fd8d14f7547c50697d4
Created new service ProjectsService and removed methods in repos_projects that belong to ProjectsService.
Minor tweaks by @gmlewis following review.
Fixes#461.
Closes#467.
Change-Id: I8b85ff6e716151b505c843c905534bd5fe8257ae
The author JSON is in the format of a user, not a commit author, and so
the author field on all the release fetching methods were nil.
Closes#439.
Change-Id: Ifc1e79a3c92b27ea65618b16a3a2fd2eb2873710
GitHub search API ratelimits are changed recently.
Reference: https://developer.github.com/v3/search/#rate-limit
Rate limit for unauthenticated requests change from 5 to 10 per minute.
And, rate limit for authenticated requests change from 20 to 30 per minute.
Signed-off-by: Yumikiyo Osanai <yumios.art@gmail.com>
According to https://developer.github.com/v3/#parameters:
For POST, PATCH, PUT, and DELETE requests, parameters
not included in the URL should be encoded as JSON with
a Content-Type of 'application/json'
Closes#407.
Change-Id: Iee60a3ed6e06b85cc64f687fd28e7663c1fc34e3
Both of those endpoints use PUT method, which means they must send
the parameters as a JSON encoded body rather than query parameters.
Source: https://developer.github.com/v3/#parametersFixes#402.
Closes#403.
Change-Id: I444d1ce9ba881200282ff617454addc2e6eb4793
This is largely a style change. In the case of NewRequest and NewUploadRequest, it is completely a noop given current code (since a new request is created, and each header is added only one time). For BasicAuthTransport, it's a noop as long as incoming request doesn't already have "X-GitHub-OTP" header set (and if it did, then this is a better behavior to change its value rather than add a new one).
Even though these changes are largely noops, Header.Set is a simpler primitive to reason about, and it's more representative of the intended action. For "Content-Type", "Accept", and "User-Agent" headers, multiple such headers do not make sense, so it's better to use Header.Set than Header.Add.