Either InterruptErr or SilentErr will be present when the user has
chosen "Cancel" or pressed Ctrl-C in prompts. We don't want the recovery
mechanism to kick in these cases because the cancellation was likely
willingly initiated by the user.
With the `--format` flag, the value of the flag is parsed as a Go
template which is then evaluated against parsed response data.
https://golang.org/pkg/text/template
When a token such as GH_TOKEN is set through environment variables and
`~/.config/gh/hosts.yml` is non-existent, the `auth git-credential get`
command used to fail due to missing username.
Since GitHub username isn't at all required for token authentication,
use the `x-access-token` faux username instead of trying to obtain one
from a config file.
Fixes a problem where setting up a new local directory for the
repository created from a template would not contain any files:
gh repo create -p OWNER/some-template my-repo --private --confirm
ls my-repo
//=> [empty directory]
Fixes#2290
In local git directory:
1. `This will add an "origin" git remote to your local repository. Continue?`
2. "origin" git remote is added in current directory.
Outside of a local git directory:
1. This will create the "REPO" repository on GitHub. Continue?
2. `Create a local project directory for "REPO"?`
3. new directory called "REPO" now set up for the GitHub repository.
* fully restore fork remote renaming behavior
* catch blank remote name and error + arg tests
* hard wrap fork usage
* do not rename if remote-name supplied
* tweak error text
Instead of checking branch protection rules on the main branch of the
repository, branch protection rules for a specific PR should be checked
on its base branch, since not all PRs are based on the main branch.
Additionally, do not display "Up to date" if the actual merge status
reported from the server was "UNKNOWN" or "DIRTY", since in those cases
"Up to date" could be false information.