(t *testing.T)
| 928 | } |
| 929 | |
| 930 | func TestPRCheckout_existingBranch(t *testing.T) { |
| 931 | http := &httpmock.Registry{} |
| 932 | defer http.Verify(t) |
| 933 | |
| 934 | baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature") |
| 935 | shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 936 | |
| 937 | cs, cmdTeardown := run.Stub() |
| 938 | defer cmdTeardown(t) |
| 939 | cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "") |
| 940 | cs.Register(`git rev-parse --verify refs/heads/feature`, 0, "") |
| 941 | cs.Register(`git checkout feature`, 0, "") |
| 942 | cs.Register(`git merge --ff-only refs/remotes/origin/feature`, 0, "") |
| 943 | |
| 944 | output, err := runCommand(http, nil, "master", `123`, baseRepo) |
| 945 | assert.NoError(t, err) |
| 946 | assert.Equal(t, "", output.String()) |
| 947 | assert.Equal(t, "", output.Stderr()) |
| 948 | } |
| 949 | |
| 950 | func TestPRCheckout_differentRepo_remoteExists(t *testing.T) { |
| 951 | remotes := context.Remotes{ |
nothing calls this directly
no test coverage detected