(t *testing.T)
| 1002 | } |
| 1003 | |
| 1004 | func TestPRCheckout_differentRepoForce(t *testing.T) { |
| 1005 | http := &httpmock.Registry{} |
| 1006 | defer http.Verify(t) |
| 1007 | |
| 1008 | baseRepo, pr := stubPR("OWNER/REPO:master", "hubot/REPO:feature") |
| 1009 | finder := shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 1010 | finder.ExpectFields([]string{"number", "headRefName", "headRepository", "headRepositoryOwner", "isCrossRepository", "maintainerCanModify"}) |
| 1011 | |
| 1012 | cs, cmdTeardown := run.Stub() |
| 1013 | defer cmdTeardown(t) |
| 1014 | cs.Register(`git fetch origin refs/pull/123/head:feature --no-tags --force`, 0, "") |
| 1015 | cs.Register(`git config branch\.feature\.merge`, 1, "") |
| 1016 | cs.Register(`git checkout feature`, 0, "") |
| 1017 | cs.Register(`git config branch\.feature\.remote origin`, 0, "") |
| 1018 | cs.Register(`git config branch\.feature\.pushRemote origin`, 0, "") |
| 1019 | cs.Register(`git config branch\.feature\.merge refs/pull/123/head`, 0, "") |
| 1020 | |
| 1021 | output, err := runCommand(http, nil, "master", `123 --force`, baseRepo) |
| 1022 | assert.NoError(t, err) |
| 1023 | assert.Equal(t, "", output.String()) |
| 1024 | assert.Equal(t, "", output.Stderr()) |
| 1025 | } |
| 1026 | |
| 1027 | func TestPRCheckout_differentRepo_existingBranch(t *testing.T) { |
| 1028 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected