Commit graph

30 commits

Author SHA1 Message Date
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
06cf2c9f81 Merge remote-tracking branch 'origin' into cmd-stub-new 2021-01-22 16:31:29 +01:00
Nate Smith
29805a4003
Merge pull request #2588 from cdce8p/gh-clone-fetch
Only fetch default branch when adding upstream remote
2021-01-21 12:57:10 -08:00
vilmibm
b906826a68 i like trunk 2021-01-21 12:56:53 -08:00
vilmibm
dcedd32249 use newer command stubbing in tests 2021-01-21 12:32:40 -08:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
Mislav Marohnić
584b33e79c Migrate to new cmd stubber in repo clone tests 2021-01-18 22:42:13 +01:00
Mislav Marohnić
39a0a8c57c Improve clone wiki test 2020-12-15 17:45:13 +01:00
gunadhya
fd57835bb9 Fix repo clone wiki 2020-12-15 17:45:03 +01:00
cdce8p
f536901bc1 Only fetch DefaultBranchRef when adding upstream remote during gh repo clone 2020-12-09 20:15:21 +01:00
boonhong
57ec879aea Fix typos 2020-11-12 22:32:36 +08:00
Alisson Santos
cf617e88f4 Extract repeated code to util function 2020-11-03 22:05:04 +01:00
Mislav Marohnić
fc969281cf Better tests for clone argument parsing 2020-10-29 16:52:50 +01:00
Eric Hagman
af1d8a60e0 Print friendly error when "gh repo clone" is missing required argument 2020-10-21 23:23:39 -04:00
Jonathan Lloyd
8f44aee76a Load repo and parent in single query 2020-10-13 20:41:16 +01:00
Jonathan Lloyd
a5ec03d000 Improve test args 2020-10-12 23:57:47 +01:00
Jonathan Lloyd
487b62d3b9 Clone repos using canonical username/repo name capitalization
GitHub user/repo names are case insentitive. This can cause issues when dealing with
repos programmatically using systems that aren't aware of this (e.g. go packages).

This commit updates the cloning logic of the CLI to query the API for the canonical
capitalization and uses that for the clone operation.

Fixes: #1845
2020-10-12 23:39:18 +01:00
Mislav Marohnić
c095a4bead Allow explicitly specifying the hostname for gh operations
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
2020-08-12 16:16:34 +02:00
Mislav Marohnić
00bdedb418 💅 Tweak wording 2020-08-11 17:06:36 +02:00
Mislav Marohnić
d876cf15b0 Merge remote-tracking branch 'origin' into issue-1456__clone-flag-help 2020-08-11 16:57:24 +02:00
Mislav Marohnić
a73584db72 Merge remote-tracking branch 'origin' into pr-commands-isolate 2020-08-04 15:01:30 +02:00
Shi Han NG
d24f33b679
Add Test_RepoClone_flagError 2020-08-01 19:23:28 +09:00
Shi Han NG
6e844fef87
Mention git clone flags in gh repo clone usage 2020-08-01 19:09:29 +09:00
Shi Han NG
ca8d032824
Add custom error for gh repo clone 2020-08-01 19:07:51 +09:00
Mislav Marohnić
ffe08995bb Add notes about GHE support for git_protocol 2020-07-29 22:50:53 +02:00
Mislav Marohnić
dd0d236629 Merge remote-tracking branch 'origin' into ghe-api 2020-07-27 20:13:54 +02:00
Mislav Marohnić
0cbcf8a7fa Merge remote-tracking branch 'origin' into ghe-api 2020-07-27 16:30:20 +02:00
vilmibm
551c3661cb linter appeasement 2020-07-24 12:29:06 -05:00
vilmibm
c34054bdc8 isolate repo create command 2020-07-24 12:26:27 -05:00
vilmibm
1831d95433 isolated clone command
This commit hacks the existing repo clone tests into something usable by
the new isolated command. It went ok and was less effort than trying to
introduce the same kind of test format as repo view and gist create.
2020-07-23 16:40:31 -05:00