(t *testing.T)
| 1124 | } |
| 1125 | |
| 1126 | func TestPRCheckout_recurseSubmodules(t *testing.T) { |
| 1127 | http := &httpmock.Registry{} |
| 1128 | |
| 1129 | baseRepo, pr := stubPR("OWNER/REPO", "OWNER/REPO:feature") |
| 1130 | shared.StubFinderForRunCommandStyleTests(t, "123", pr, baseRepo) |
| 1131 | |
| 1132 | cs, cmdTeardown := run.Stub() |
| 1133 | defer cmdTeardown(t) |
| 1134 | cs.Register(`git fetch origin \+refs/heads/feature:refs/remotes/origin/feature --no-tags`, 0, "") |
| 1135 | cs.Register(`git show-ref --verify -- refs/heads/feature`, 0, "") |
| 1136 | cs.Register(`git checkout feature`, 0, "") |
| 1137 | cs.Register(`git merge --ff-only refs/remotes/origin/feature`, 0, "") |
| 1138 | cs.Register(`git submodule sync --recursive`, 0, "") |
| 1139 | cs.Register(`git submodule update --init --recursive`, 0, "") |
| 1140 | |
| 1141 | output, err := runCommand(http, nil, "master", `123 --recurse-submodules`, baseRepo) |
| 1142 | assert.NoError(t, err) |
| 1143 | assert.Equal(t, "", output.String()) |
| 1144 | assert.Equal(t, "", output.Stderr()) |
| 1145 | } |
| 1146 | |
| 1147 | func TestPRCheckout_force(t *testing.T) { |
| 1148 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected