(t *testing.T)
| 535 | } |
| 536 | |
| 537 | func TestPRCheckout_existingBranch(t *testing.T) { |
| 538 | http := &httpmock.Registry{} |
| 539 | defer http.Verify(t) |
| 540 | |
| 541 | baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature") |
| 542 | shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 543 | |
| 544 | cs, cmdTeardown := run.Stub() |
| 545 | defer cmdTeardown(t) |
| 546 | cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "") |
| 547 | cs.Register(`git show-ref --verify -- refs/heads/feature`, 0, "") |
| 548 | cs.Register(`git checkout feature`, 0, "") |
| 549 | cs.Register(`git merge --ff-only refs/remotes/origin/feature`, 0, "") |
| 550 | |
| 551 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 552 | assert.NoError(t, err) |
| 553 | assert.Equal(t, "", output.String()) |
| 554 | assert.Equal(t, "", output.Stderr()) |
| 555 | } |
| 556 | |
| 557 | func TestPRCheckout_differentRepo_remoteExists(t *testing.T) { |
| 558 | remotes := context.Remotes{ |
nothing calls this directly
no test coverage detected