(t *testing.T)
| 285 | } |
| 286 | |
| 287 | func Test_RepoClone_hasParent_upstreamRemoteName(t *testing.T) { |
| 288 | reg := &httpmock.Registry{} |
| 289 | defer reg.Verify(t) |
| 290 | reg.Register( |
| 291 | httpmock.GraphQL(`query RepositoryInfo\b`), |
| 292 | httpmock.StringResponse(` |
| 293 | { "data": { "repository": { |
| 294 | "name": "REPO", |
| 295 | "owner": { |
| 296 | "login": "OWNER" |
| 297 | }, |
| 298 | "parent": { |
| 299 | "name": "ORIG", |
| 300 | "owner": { |
| 301 | "login": "hubot" |
| 302 | }, |
| 303 | "defaultBranchRef": { |
| 304 | "name": "trunk" |
| 305 | } |
| 306 | } |
| 307 | } } } |
| 308 | `)) |
| 309 | |
| 310 | httpClient := &http.Client{Transport: reg} |
| 311 | |
| 312 | cs, cmdTeardown := run.Stub() |
| 313 | defer cmdTeardown(t) |
| 314 | |
| 315 | cs.Register(`git clone https://github.com/OWNER/REPO.git`, 0, "") |
| 316 | cs.Register(`git -C REPO remote add -t trunk test https://github.com/hubot/ORIG.git`, 0, "") |
| 317 | cs.Register(`git -C REPO fetch test`, 0, "") |
| 318 | cs.Register(`git -C REPO remote set-branches test *`, 0, "") |
| 319 | cs.Register(`git -C REPO config --add remote.test.gh-resolved base`, 0, "") |
| 320 | |
| 321 | _, err := runCloneCommand(httpClient, "OWNER/REPO --upstream-remote-name test") |
| 322 | if err != nil { |
| 323 | t.Fatalf("error running command `repo clone`: %v", err) |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | func Test_RepoClone_withoutUsername(t *testing.T) { |
| 328 | reg := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected