Commit graph

76 commits

Author SHA1 Message Date
Boston Cartwright
bb9bf29835
pr merge switch to base branch if available (#5251)
* after merge, switch to base branch if available

* Add ability to checkout new branch

* Style cleanup

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-03-14 14:02:57 +02:00
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
nate smith
4996ba2ba4 Merge remote-tracking branch 'origin/trunk' into relative-path 2021-10-14 12:24:27 -05: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ć
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ć
06cf2c9f81 Merge remote-tracking branch 'origin' into cmd-stub-new 2021-01-22 16:31:29 +01:00
Mislav Marohnić
1717c8d083 Migrate to new cmd stubber in git tests 2021-01-18 22:39:59 +01:00
cdce8p
f536901bc1 Only fetch DefaultBranchRef when adding upstream remote during gh repo clone 2020-12-09 20:15:21 +01: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
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
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
Corey Johnson
e643765027 Merge remote-tracking branch 'origin/merge-interactive-merge' into remote-delete 2020-05-22 15:09:29 -07:00
Corey Johnson
858cd705ab Update name 2020-05-22 15:07:39 -07:00
Corey Johnson
368aacbff6 Fully qualify that ref 2020-05-22 14:55:32 -07:00
Corey Johnson
d7c933bc40 branchCmd 2020-05-22 14:52:29 -07:00
Corey Johnson
28d8a9e781 Use big D 2020-05-22 14:40:38 -07:00
Corey Johnson
ae70a814bd Update tests 2020-05-20 14:53:52 -07:00
Corey Johnson
904c541d2d Only delete local branch if it exists 2020-05-20 14:19:44 -07:00
Corey Johnson
a303dabc5d Add remote deletion 2020-05-20 13:47:29 -07:00
Corey Johnson
f0cd830170 Fix merge flag
Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
2020-05-12 09:22:37 -07:00
Corey Johnson
326b678b24 Add delete branch
Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
2020-05-12 08:51:22 -07:00
vilmibm
44acdd4ec3 Merge branch 'master' into pr-status-no-commits 2020-03-30 12:04:02 -05:00
vilmibm
eb403a3b1e more nuanced error typing 2020-03-27 11:35:39 -05:00
vilmibm
ca99096ca8 use CmdError in StubError and fix git_test 2020-03-26 15:32:31 -05:00
vilmibm
0af232444c consolidate into one symbolic-ref call 2020-03-26 15:00:58 -05:00
Mislav Marohnić
cba8331d55 Avoid auto-forking/pushing an already pushed branch in pr create
A branch is considered already pushed if its HEAD commit hash matches
the commit hash of one of the remote tracking branches:
`refs/remotes/<remote>/<branch>`

This mechanism allows the user to:

- Choose a remote as push target for their branch different than the one
  that would automatically get chosen for them by `pr create`;

- Avoid a `git push` operation (and its associated git hooks) if a push
  was not necessary in the first place.
2020-03-26 20:35:42 +01:00
Mislav Marohnić
3907914225 Guard against filesystem paths in git.ReadBranchConfig
A valid remote specificication read from `branch.<name>.remote` git
config can be a URL, a `.`, a filesystem path, and a remote name. When
detecting the remote name, be sure not to take filesystem paths instead.
2020-03-26 19:23:17 +01:00
Mislav Marohnić
c36b84e550 Convert git.VerifyRef into a more versatile ShowRefs
This is so we can pass a list of full qualified refs and have them
resolved for both existence and their commit hashes.
2020-03-26 19:21:40 +01:00
vilmibm
897d5c3dca fall back to symbolic-ref in CurrentBranch 2020-03-25 11:57:53 -05:00
vilmibm
4632ab1a1e test for CurrentBranch on an empty repo 2020-03-24 14:19:35 -05:00
vilmibm
5187ad4431 move preparecmd and Runnable to its own package 2020-03-23 16:32:29 -05:00
vilmibm
121173c330 better error reporting + catch for empty repo 2020-03-23 15:21:58 -05:00