Repository navigation
Commit 165efcc
committed
test(check-pr-size): pin initTestRepo's initial branch so go test passes under init.defaultBranch=main
initTestRepo ran `git init -q` with no `-b`, so the fixture repo's first
branch was whatever the developer's `init.defaultBranch` happened to be.
TestResolveMergeBaseWithAdvancedBaseBranch then runs
`git checkout -q -b main <forkPoint>`, which fails with
`fatal: a branch named 'main' already exists` on any machine configured with
`init.defaultBranch = main`. CI is green only because the ubuntu-latest
runner's git still defaults to `master`.
Pin the fixture's initial branch to a sentinel name so it can never collide
with a branch the tests create themselves. `-b` needs git >= 2.28, the same
release that introduced `init.defaultBranch`, so no supported git regresses.1 parent 75685ed commit 165efcc
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
0 commit comments