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

Function TestPRCheckout_differentRepo_existingBranch

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

Source from the content-addressed store, hash-verified

632}
633
634func TestPRCheckout_differentRepo_existingBranch(t *testing.T) {
635 http := &httpmock.Registry{}
636 defer http.Verify(t)
637
638 baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature")
639 shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo)
640
641 cs, cmdTeardown := run.Stub()
642 defer cmdTeardown(t)
643 cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags`, 0, "")
644 cs.Register(`git config branch\.feature\.merge`, 0, "refs/heads/feature\n")
645 cs.Register(`git checkout feature`, 0, "")
646
647 output, err := runCommand(http, nil, "master", `123`, baseRepo)
648 assert.NoError(t, err)
649 assert.Equal(t, "", output.String())
650 assert.Equal(t, "", output.Stderr())
651}
652
653func TestPRCheckout_detachedHead(t *testing.T) {
654 http := &httpmock.Registry{}

Callers

nothing calls this directly

Calls 9

VerifyMethod · 0.95
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