Summary
fixtures/workspace_flow/bootstrap.sh creates its repositories with a bare git init, so the branch is whatever the host git defaults to. Two tests built on that fixture then hardcode main, and fail on any machine where init.defaultBranch is unset and git still defaults to master (git 2.43 here).
t/t9014-workspace-hub-flow.sh — 2 of 2 fail
t/t90010-workspace-git-compat.sh — 2 of 7 fail
Setting git config --global init.defaultBranch main makes both pass, which pins the cause.
Repro
git config --global --unset init.defaultBranch # or start from a clean machine
bash t/t9014-workspace-hub-flow.sh
not ok 1 - setup: bootstrap workspace, init hub, and create PR
cat: ws-flow-pr-id.txt: No such file or directory
not ok 2 - workspace flow --pr records workflow result with fingerprint
# passed: 0 failed: 2
Walking the setup by hand shows where it breaks:
error: pathspec 'main' did not match any file(s) known to git
hub failed: Target branch not found: refs/heads/main
The fixture produced master:
$ fixtures/workspace_flow/bootstrap.sh ws && git -C ws symbolic-ref HEAD
refs/heads/master
Cause
fixtures/workspace_flow/bootstrap.sh:23
cd "$repo_dir"
git init -q # no -b, no init.defaultBranch
while t9014 does git checkout main and bit hub pr create --base refs/heads/main, and t90010 does git push -u origin main.
Suggested fix
Pin the branch in the fixture — git init -q -b main (or git symbolic-ref HEAD refs/heads/main right after, for older git) — so the tests do not depend on the host's git configuration. The seven other tests on this fixture do not name a branch and are unaffected either way.
Note on visibility
These tests are not run by CI: no job invokes the test-subdir task, so nothing under t/ runs there. They are only reached by pkf run test-subdir or bash t/run-tests.sh locally, which is why the breakage has gone unnoticed.
Separately, that task's filter is a substring match, so t900 alone also skips t9011–t9021 — including t9020-http-push-negotiation.sh. #190 adds a t902 pass for t9020 and the new shallow test; t9011–t9018 are still not covered by any filter.
Summary
fixtures/workspace_flow/bootstrap.shcreates its repositories with a baregit init, so the branch is whatever the host git defaults to. Two tests built on that fixture then hardcodemain, and fail on any machine whereinit.defaultBranchis unset and git still defaults tomaster(git 2.43 here).t/t9014-workspace-hub-flow.sh— 2 of 2 failt/t90010-workspace-git-compat.sh— 2 of 7 failSetting
git config --global init.defaultBranch mainmakes both pass, which pins the cause.Repro
git config --global --unset init.defaultBranch # or start from a clean machine bash t/t9014-workspace-hub-flow.shWalking the setup by hand shows where it breaks:
The fixture produced
master:$ fixtures/workspace_flow/bootstrap.sh ws && git -C ws symbolic-ref HEAD refs/heads/masterCause
fixtures/workspace_flow/bootstrap.sh:23while
t9014doesgit checkout mainandbit hub pr create --base refs/heads/main, andt90010doesgit push -u origin main.Suggested fix
Pin the branch in the fixture —
git init -q -b main(orgit symbolic-ref HEAD refs/heads/mainright after, for older git) — so the tests do not depend on the host's git configuration. The seven other tests on this fixture do not name a branch and are unaffected either way.Note on visibility
These tests are not run by CI: no job invokes the
test-subdirtask, so nothing undert/runs there. They are only reached bypkf run test-subdirorbash t/run-tests.shlocally, which is why the breakage has gone unnoticed.Separately, that task's filter is a substring match, so
t900alone also skipst9011–t9021— includingt9020-http-push-negotiation.sh. #190 adds at902pass fort9020and the new shallow test;t9011–t9018are still not covered by any filter.