The `cutSuffix` function was added to backport the functionality of
`strings.CutSuffix` from Go 1.20. Now that we're using Go 1.25, we can
safely replace our backport with the standard library function. Our
backport was an intact copy/paste of the stdlib implementation, so this
change does not alter any behavior.
Signed-off-by: Babak K. Shandiz <babakks@github.com>
* Allow `gh auth git-credential` to authenticate GitHub Gist requests
When there are stored credentials for `example.com`, allow using them to
authenticate requests to `gist.example.com` as well.
* Fix writing out of credential config
* remove unneccessary function
* actually delete
Co-authored-by: nate smith <vilmibm@github.com>
Accept the "HOST/OWNER/REPO" syntax or passing a full URL for both the
`--repo` flag and the GH_REPO environment variable and allow setting
GH_HOST environment variable to override just the hostname for
operations that assume "github.com" by default.
Examples:
$ gh repo clone example.org/owner/repo
$ GH_HOST=example.org gh repo clone repo
$ GH_HOST=example.org gh api user
$ GH_HOST=example.org gh gist create myfile.txt
$ gh issue list -R example.org/owner/repo
$ gh issue list -R https://example.org/owner/repo.git
$ GH_REPO=example.org/owner/repo gh issue list