Commit graph

22 commits

Author SHA1 Message Date
Babak K. Shandiz
72fcd8c87d
Improve error message returned by FindByRepo
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-02 21:46:28 +01:00
vilmibm
7e3e2d96a8 Merge remote-tracking branch 'origin/trunk' into base-cmd 2022-12-13 10:39:40 -08:00
Sam Coe
743a747804
Use go-gh for SSH hostname alias translation (#5654) 2022-06-08 21:32:29 +00:00
Sam Coe
22a5d2abf8
Refactor code to live inside default pkg 2022-05-18 08:40:30 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
aef1a4ba4d Extract root command and factory logic into separate packages 2020-08-07 14:40:33 +02:00
Mislav Marohnić
3ea71e6eb6 Add ability to parse non-GitHub.com git remotes 2020-06-23 19:51:26 +02:00
Mislav Marohnić
8453bf679c Fix parsing non-GitHub remotes
Otherwise, the remote URL translation mechanism had crashed when
encountering a non-Github.com git remote.
2020-01-28 19:51:44 +01:00
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Mislav Marohnić
1f90579d2a Extract common interface for a GitHub Repository
Also define a handful of utility methods:
- `New(owner, repo)`
- `FullName`: the name slash owner pair
- `FromFullName`: parse the name slash owner pair
- `FromURL`: parse a GitHub.com URL
- `IsSame(r1, r2)`: compare two repositories
2020-01-22 22:44:46 +01:00
Mislav Marohnić
7a614ce697 Support triangular git workflows in pr create
- The local git remotes are scanned and resolved to GitHub repositories
- The "base" repo is the first result resolved to its parent repo (if a fork)
- The name of the default branch is read from the base repo
- The "head" repo is the first repo that has push access
2020-01-21 18:26:08 +01:00
Mislav Marohnić
eff8847513 Improve detecting PR for the current branch
Now reads git branch configuration and handles these cases:

    branch ["foo"]
      remote origin
      merge  refs/heads/bar

    branch ["foo"]
      remote other-remote
      merge  refs/heads/foo

    branch ["foo"]
      remote https://github.com/OWNER/REPO.git
      merge  refs/heads/bar

    branch ["foo"]
      remote origin
      merge  refs/pull/123/head
2019-11-20 15:20:36 +01:00
Mislav Marohnić
4fab43a667 Cover more pr checkout test scenarios 2019-11-14 20:53:34 +01:00
Mislav Marohnić
dc0de147c9 Add pr checkout command 2019-11-14 19:59:42 +01:00
Mislav Marohnić
f786802e9e Customizable API client 2019-10-29 21:07:03 +01:00
Mislav Marohnić
641de86427 Eliminate package-level state in git remote parsing 2019-10-25 21:48:25 +02:00
Mislav Marohnić
79e8766d8f Use eq in more tests 2019-10-17 14:44:53 +02:00
Mislav Marohnić
c09eb742c3 Keep original order of remotes 2019-10-17 13:46:35 +02:00
Mislav Marohnić
a8aa5feb02 Test remote parsing 2019-10-17 02:25:59 +02:00
Mislav Marohnić
8016d80884 Create overridable Context interface 2019-10-17 02:25:59 +02:00
nate smith
d7ee9a0ade move remote to context package 2019-10-10 17:42:52 -05:00
Renamed from github/remote.go (Browse further)