Commit graph

27 commits

Author SHA1 Message Date
wilso199
267400a3a5 Cleaning up formatting errors and updating test to use named api call 2020-08-02 22:37:47 -04:00
wilso199
4250906c82 Adding test to ensure submodule commands are executed 2020-08-02 22:17:42 -04:00
Mislav Marohnić
dfb774cd38 Verify HTTP stubs in pr checkout tests 2020-07-15 16:18:36 +02:00
Mislav Marohnić
c232c8872c Abort pr checkout when PR has an invalid head branch name 2020-07-15 16:16:38 +02:00
Mislav Marohnić
305cd290ee Fix pr checkout <owner>:<branch> when it matches the default branch
First, consolidate the functionality between `pr merge` and `pr
checkout` that resolves the default branch name of the base repo. With
an added bonus, the new approach avoids an API request when one isn't
necessary.

Then, ensure that checking out 3rd-party PRs will result in local branch
name such as `<owner>/<branch>` when the head branch of the repository
matches the default branch of the base repository. We already have had
code in place to take care of this, but it only took effect in the `pr
checkout <number>`-style invocation.
2020-07-15 15:35:42 +02:00
Mislav Marohnić
6825944cad Reference named queries in pr checkout HTTP stubs 2020-07-15 14:54:30 +02:00
Corey Johnson
f490a4914f Don't need extra determineBaseRepo call 2020-06-04 10:30:41 -07:00
Corey Johnson
4c75c8bccc Reset base branch when URL is used 2020-06-03 14:34:13 -07:00
Corey Johnson
4ef73a723d Update all calls to RunCommand 2020-05-05 09:20:01 -07:00
Mislav Marohnić
734497a8d8
Code fixes informed by golangci-lint failures (#738) 2020-04-03 16:33:34 +02:00
vilmibm
44acdd4ec3 Merge branch 'master' into pr-status-no-commits 2020-03-30 12:04:02 -05: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
dd877b6a34 merge fallout 2020-03-25 12:01:44 -05:00
vilmibm
f4b8851011 Merge remote-tracking branch 'origin/master' into pr-status-no-commits 2020-03-25 12:00:58 -05:00
vilmibm
dd1e2a2dfc add StubError to CmdStubber 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
Mislav Marohnić
9786498a25 Respect base repository when passing URL argument to pr checkout/view
Previously, the repository owner+name component of the URL was ignored
and only the pull request number was read. Now, the URL dictates which
base repository will be used.
2020-03-20 18:06:40 +01:00
vilmibm
ed8aaa83e3 add CmdStubber 2020-03-13 15:12:09 -05:00
vilmibm
c5a511a2d1 Revert "prefix branch names for local pr checkout"
This reverts commit 5b8d7c1841.
2020-02-13 17:16:53 -06:00
vilmibm
5b8d7c1841 prefix branch names for local pr checkout 2020-02-04 17:49:02 -06:00
Mislav Marohnić
a710893fc1 Rename to cli/cli 2020-01-24 16:08:52 +01:00
Mislav Marohnić
48aeff1ca7 Assert stdout separarely from stderr in command tests
This stubs stderr separately from stdout in command tests (before those
streams were combined) and improves test assertions around output.

Additionally, no longer use the `cmd.Print*()` family of Cobra functions
because their name sounds like the text will go to stdout, but they
write to stderr instead. Use the more explicit `cmd.ErrOrStderr()` as
output destination instead.
2019-12-16 15:46:42 +01:00
Mislav Marohnić
29de133ccf Accept PR URL or branch argument in pr checkout <pr> 2019-12-03 21:19:09 +01:00
Mislav Marohnić
2621bccc44 Use RunCommand in tests to ensure flags reset between runs 2019-12-03 17:26:28 +01:00
Mislav Marohnić
4fab43a667 Cover more pr checkout test scenarios 2019-11-14 20:53:34 +01:00
Mislav Marohnić
1fc9c8f9d6 Test the scenario where the target branch already exists 2019-11-14 20:29:24 +01:00
Mislav Marohnić
dc0de147c9 Add pr checkout command 2019-11-14 19:59:42 +01:00