(t *testing.T)
| 609 | } |
| 610 | |
| 611 | func TestPRCheckout_differentRepoForce(t *testing.T) { |
| 612 | http := &httpmock.Registry{} |
| 613 | defer http.Verify(t) |
| 614 | |
| 615 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 616 | finder := shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 617 | finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"}) |
| 618 | |
| 619 | cs, cmdTeardown := run.Stub() |
| 620 | defer cmdTeardown(t) |
| 621 | cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags --force`, 0, "") |
| 622 | cs.Register(`git config branch\.feature\.merge`, 1, "") |
| 623 | cs.Register(`git checkout feature`, 0, "") |
| 624 | cs.Register(`git config branch\.feature\.remote origin`, 0, "") |
| 625 | cs.Register(`git config branch\.feature\.pushRemote origin`, 0, "") |
| 626 | cs.Register(`git config branch\.feature\.merge refs/pull/123/head`, 0, "") |
| 627 | |
| 628 | output, err := runCommand(http, nil, "master", `123 --force`, baseRepo) |
| 629 | assert.NoError(t, err) |
| 630 | assert.Equal(t, "", output.String()) |
| 631 | assert.Equal(t, "", output.Stderr()) |
| 632 | } |
| 633 | |
| 634 | func TestPRCheckout_differentRepo_existingBranch(t *testing.T) { |
| 635 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected