MCPcopy Create free account
hub / github.com/cli/cli / TestPRCheckout_recurseSubmodules

Function TestPRCheckout_recurseSubmodules

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

Source from the content-addressed store, hash-verified

1122}
1123
1124func TestPRCheckout_recurseSubmodules(t *testing.T) {
1125 http := &httpmock.Registry{}
1126
1127 baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature")
1128 shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo)
1129
1130 cs, cmdTeardown := run.Stub()
1131 defer cmdTeardown(t)
1132 cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "")
1133 cs.Register(`git rev-parse --verify refs/heads/feature`, 0, "")
1134 cs.Register(`git checkout feature`, 0, "")
1135 cs.Register(`git merge --ff-only refs/remotes/origin/feature`, 0, "")
1136 cs.Register(`git submodule sync --recursive`, 0, "")
1137 cs.Register(`git submodule update --init --recursive`, 0, "")
1138
1139 output, err := runCommand(http, nil, "master", `123 --recurse-submodules`, baseRepo)
1140 assert.NoError(t, err)
1141 assert.Equal(t, "", output.String())
1142 assert.Equal(t, "", output.Stderr())
1143}
1144
1145func TestPRCheckout_force(t *testing.T) {
1146 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
StringMethod · 0.65
RegisterMethod · 0.45

Tested by

no test coverage detected