Now `hub remote` will only prompt to select from your configured hosts
if it can't infer the GitHub hostname from existing remotes.
In case you're prompted, and you choose a GHE host, now that choice will
be properly reflected in the generated URL, unlike before when it would
always revert to "github.com" regardless of choice.
Fixes#1141
When the repo that hosts the `head` for the PR is moved to another
owner, the `owner:branch` specification will be wrong and the GitHub API
will return HTTP 422.
This resolves the latest owner/name pair for head repo so that the value
is never stale when submitting new PR to be created.
Fixes#467
Also, adopt the new name of the fork more precisely so it's reflected in
the new remote URL. The name of the new git remote is for now *not*
inherited from the returned Repository object for backwards compatibility.
Fixes#1178
HTTP client used to automatically follow GET redirects, or turn certain
POST redirects to GET when applicable, but for opening a new pull
request for a renamed repo, we need to repeat the POST against the
updated location.
Instead of per-request approach of invoking `client.requestURL()`
manually whenever we're constructing a request path, simply define the
`/api/v3` prefix when configuring the API root URL for `simpleApi` client.
Git Hub Enterprise requests should always include /api/v3 in the URL
in order to hit the correct API endpoint. The ci-status and release
commands were producing the wrong request URL. As result, an LDAP
authentication page was returned rather than the expected JSON. A
parsing error could be seen: "invalid character '<' looking for beginning
of value".
This commit changes the construction of the request URL for the
ci-status and release commands, making sure the existing client.requestURL
function is called. This makes sure the API request hits always hits the
right endpoint in Git Hub Enterprise.
The `create` and `remote` commands needs to infer the current project
name from the project's directory. Instead of using the current working
directory, which doesn't necessarily match the project's toplevel
directory, use `git rev-parse --show-toplevel` which also respects the
`-C` global flag setting.
Fixes#1105, closes#1114