Commit graph

15 commits

Author SHA1 Message Date
nate smith
54b82dd072 Migrate to binary style extensions when detected 2021-11-17 13:15:04 -06:00
Parth Patel
dd87e80b4c added final touches 2021-10-20 16:12:32 -04:00
Parth Patel
ddd0b7cb04 added remote update 2021-10-18 16:43:40 -04:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
5b4a08dcb9 Ensure that only PATH is searched when shelling out to external commands
Works around https://github.com/golang/go/issues/38736 for Windows.
2020-11-11 16:33:13 +01:00
Mislav Marohnić
d534a94d1b Change how base repository is resolved
On first run in a git repository, `BaseRepo()` will now prompt the user
which repository should be queried as base repository if there are
multiple git remotes or when we are in the context of a fork.

In non-interactive mode, the prompt is skipped and we default to the
first git remote instead.

After the base repo is resolved, the result is cached in the local
repository using `git config` so that RepositoryNetwork API lookups can
be avoided in the future.
2020-09-15 21:27:12 +02:00
Mislav Marohnić
4315c09501 Ignore non-pre-authenticated hosts when parsing git remotes
This ensures that while having git remotes to point to either
`github.com` or authenticated GHE instances, adding another git remote
pointing to an unrelated host won't change the remote resolution in any
way, even if the unrelated remote is called `upstream` or `github` (and
thus normally took precedence).
2020-08-12 18:13:05 +02:00
vilmibm
bec58ede98 respect ssh
this adds recognition of the git_protocol setting when:

- creating a repo
- cloning a repo
- forking a repo
- forking/pushing during pr create
- checking out a PR

additionally, it:

- consolidates remote adding to use AddRemote; this introduces a fetch
where there previously hadn't been one
- changes repo clone to accept an ssh url
- changes repo fork to accept an ssh url

i just added basic unit tests; adding new test cases for all of the
above scenarios seemed like diminishing returns.
2020-04-22 14:21:01 -05:00
vilmibm
44acdd4ec3 Merge branch 'master' into pr-status-no-commits 2020-03-30 12:04:02 -05:00
vilmibm
5187ad4431 move preparecmd and Runnable to its own package 2020-03-23 16:32:29 -05:00
Mislav Marohnić
e3653672a8 Simplify git.AddRemote implementation
The 2nd argument now unused since we've determined that, in practice, we
can safely fetch git objects from a freshly created fork on GitHub and
that we don't need the remote URL-swapping workaround.
2020-03-20 13:08:33 +01:00
Odin Ugedal
12887db9c8
Fix wrong repo url being used for pushing
afaik this should be finalURL (the fork) and not initURL (the upstream),
otherwise a bit of the code above can be removed.
2020-02-13 17:30:54 +01:00
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Mislav Marohnić
e2a825effb Auto-fork on pr create if no pushable target found 2020-01-22 18:32:06 +01:00
Mislav Marohnić
641de86427 Eliminate package-level state in git remote parsing 2019-10-25 21:48:25 +02:00