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.
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).
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.
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.