Commit graph

114 commits

Author SHA1 Message Date
Parth
c987c5711d
pr merge: pull after switching branches (#4748) 2021-11-29 18:26:35 +01:00
Nate Smith
b5d90e1204
Merge pull request #4588 from cli/bin-ext-migrate
binary extension migration
2021-11-17 13:22:28 -06:00
Meijke
0a0a358168
rewrite gh repo create (#4578)
Co-authored-by: Parth Patel <ppatil91099@gmail.com>
2021-11-17 20:16:37 +01:00
nate smith
54b82dd072 Migrate to binary style extensions when detected 2021-11-17 13:15:04 -06:00
Parth Patel
8e72d48e72 Merge branch 'trunk' into repo-rename 2021-10-20 16:16:31 -04: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
nate smith
4996ba2ba4 Merge remote-tracking branch 'origin/trunk' into relative-path 2021-10-14 12:24:27 -05:00
Marwan Sulaiman
b9bdef2b00
Add org scoped port forwarding + fix test formatting (#4497)
* Add org scoped port forwarding + fix test formatting

* Redesign port visibility

* Update pkg/cmd/codespace/ports.go

Co-authored-by: Jose Garcia <josebalius@github.com>

* Change sub command to privacy

* Example pr comment

* Fix test mock

* Fix test mock

Co-authored-by: Jose Garcia <josebalius@github.com>
2021-10-13 13:56:03 -04:00
Dan Burzo
9f43967042 Fixes #4346: allow git+https URL protocol 2021-09-20 19:35:06 +03:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
21521b06b9 Check git presence during auth login only if it's going to be needed 2021-08-11 19:22:16 +02:00
bchadwic
8469441464 new functionality: current folder './', parent folder '../', absolute 'filename' 2021-07-25 23:53:27 -07:00
bchadwic
b3a24d273b cleaned up git.go, browse_test.go, and browse.go 2021-07-16 00:07:04 -07:00
bchadwic
25a35a6e88 added relative path access in gh browse 2021-07-15 23:38:54 -07:00
Mislav Marohnić
492f45422e Add a note about the style of git tests 2021-02-26 13:07:38 +01:00
Mislav Marohnić
d97e8fe172 Add live tests for some methods in the git package
We relied too much on stubs for these methods. These new tests actually
invoke `git` commands in the context of a test repository.
2021-02-24 15:05:56 +01:00
Mislav Marohnić
0f85304e3e Avoid crash in pr merge when verifying whether a PR had diverged
A PR is not guaranteed to have commits, it seems, so add a guard against
assuming that there is always a head commit.
2021-02-24 14:37:29 +01:00
Sam Coe
3f172ad991
Add contional and tests 2021-01-25 13:27:32 -08:00
zamasu
e4b9f7cb8c
Alert unpushed commits when merging a pull request 2021-01-25 12:04:32 -08:00
Mislav Marohnić
64fda21116 Avoid ever invoking go-homedir when config was found in a new location 2021-01-22 20:22:32 +01:00
Matthew Gleich
7d9461b819 ♻️ Refactor to use os.UserHomeDir() 2021-01-22 18:51:28 +01: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
dcedd32249 use newer command stubbing in tests 2021-01-21 12:32:40 -08:00
Cristian Dominguez
45f4a1f087 Equal: flip arguments position 2021-01-18 21:00:59 -03:00
Mislav Marohnić
1717c8d083 Migrate to new cmd stubber in git tests 2021-01-18 22:39:59 +01:00
Cristian Dominguez
3afb1d0b1a Use Testify assertions in test 2021-01-16 19:19:30 -03:00
Mislav Marohnić
935f6444ae Refactor ssh parser for format compatibility & testability
- Per ssh_config(5), keywords and arguments may be separated by an `=`
  sign as well as whitespace.
- When following the `Include` directive, skip directories that were
  returned as the result of globbing.
- Respect the `Host` context when recursing into `Include`s
- Avoid having tests read from the actual filesystem.
- Avoid repeatedly looking up the home directory.
2020-12-15 15:59:18 +01:00
Alisson Santos
dc8698ee46 Make ssh parser to parse included config files 2020-12-15 15:37:17 +01:00
cdce8p
f536901bc1 Only fetch DefaultBranchRef when adding upstream remote during gh repo clone 2020-12-09 20:15:21 +01:00
Josh Soref
c8b9486fd3 spelling: nonexistent 2020-11-21 21:43:51 -05:00
Mislav Marohnić
38f68d849f Improve error message when git isn't found 2020-11-11 16:33:13 +01: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
Sam Coe
28b3b2c9e7
Address PR comments 2020-11-03 09:59:09 +03:00
Sam Coe
97504f4f1f
Filter out unwanted stderr output during git push commands 2020-11-03 09:58:29 +03:00
Mislav Marohnić
2eab4a940f
Merge pull request #2025 from mmontes11/pr-create-use-git-branch-show-current
Avoding --short option in git symbolic-ref for getting the current branch
2020-10-06 14:31:34 +02:00
Dimitris Apostolou
6f550b5d12
Fix typos 2020-10-04 22:16:30 +03:00
Martín Montes
2a166d1dd7 Using TrimPrefix for getting current branch and improved tests 2020-09-30 18:26:22 +02:00
Martín Montes
3ef1693881 Using symbolic-ref for getting branch and parsing its output 2020-09-30 13:44:16 +02:00
Martín Montes
0e2e97af68 Using git branch --show-current for getting the current branch. Fallback to symbolic-ref 2020-09-29 22:45:32 +02: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ć
3e7a2585c5 Tighten git remote URL parsing
We now only support git URLs that have one of the explicitly supported protocols.
2020-09-04 16:18:26 +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
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
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
Mislav Marohnić
ab903bdfc0
Merge pull request #1155 from metalogical/FIX-detached-head
fix regression in support for detached HEAD state
2020-06-24 17:01:22 +02:00
gedenata
8ffd0d59f6 redundant type composite literal 2020-06-12 04:23:51 +08:00
naman
3bb6983b35 fix regression in support for detached HEAD state
for gh pr status
2020-06-10 11:41:44 -07:00
Corey Johnson
9113092f5c Delete via api 2020-05-22 15:19:39 -07:00