MCPcopy Index your code
hub / github.com/cli/cli / TestPRCheckout_recurseSubmodules

Function TestPRCheckout_recurseSubmodules

pkg/cmd/pr/checkout/checkout_test.go:731–750  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

729}
730
731func TestPRCheckout_recurseSubmodules(t *testing.T) {
732 http := &httpmock.Registry{}
733
734 baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature")
735 shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo)
736
737 cs, cmdTeardown := run.Stub()
738 defer cmdTeardown(t)
739 cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "")
740 cs.Register(`git show-ref --verify -- refs/heads/feature`, 0, "")
741 cs.Register(`git checkout feature`, 0, "")
742 cs.Register(`git merge --ff-only refs/remotes/origin/feature`, 0, "")
743 cs.Register(`git submodule sync --recursive`, 0, "")
744 cs.Register(`git submodule update --init --recursive`, 0, "")
745
746 output, err := runCommand(http, nil, "master", `123 --recurse-submodules`, baseRepo)
747 assert.NoError(t, err)
748 assert.Equal(t, "", output.String())
749 assert.Equal(t, "", output.Stderr())
750}
751
752func TestPRCheckout_force(t *testing.T) {
753 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 8

StubFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
stubPRFunction · 0.70
runCommandFunction · 0.70
RegisterMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected