(t *testing.T, seedDir, remoteDir, branch, contents, message string)
| 428 | } |
| 429 | |
| 430 | func advanceRemoteBranch(t *testing.T, seedDir, remoteDir, branch, contents, message string) { |
| 431 | t.Helper() |
| 432 | |
| 433 | seedRepo, err := git.PlainOpen(seedDir) |
| 434 | if err != nil { |
| 435 | t.Fatalf("open seed repo: %v", err) |
| 436 | } |
| 437 | worktree, err := seedRepo.Worktree() |
| 438 | if err != nil { |
| 439 | t.Fatalf("open seed worktree: %v", err) |
| 440 | } |
| 441 | if err := worktree.Checkout(&git.CheckoutOptions{Branch: plumbing.NewBranchReferenceName(branch)}); err != nil { |
| 442 | t.Fatalf("checkout branch %s: %v", branch, err) |
| 443 | } |
| 444 | commitBranchMarker(t, seedDir, worktree, testBranchSpec{name: branch, contents: contents}, message) |
| 445 | if err := seedRepo.Push(&git.PushOptions{ |
| 446 | RemoteName: "origin", |
| 447 | RefSpecs: []gitconfig.RefSpec{ |
| 448 | gitconfig.RefSpec(plumbing.NewBranchReferenceName(branch).String() + ":" + plumbing.NewBranchReferenceName(branch).String()), |
| 449 | }, |
| 450 | }); err != nil { |
| 451 | t.Fatalf("push branch %s update to %s: %v", branch, remoteDir, err) |
| 452 | } |
| 453 | } |
| 454 | |
| 455 | func advanceRemoteBranchFromNewBranch(t *testing.T, seedDir, remoteDir, branch, contents, message string) { |
| 456 | t.Helper() |
no test coverage detected