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

Function TestPRCheckout_recurseSubmodules

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

Source from the content-addressed store, hash-verified

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