fix(fixtures): pin the workspace_flow branch to main, and ignore t/ trash directories - #192
Merged
Merged
Conversation
fixtures/workspace_flow/bootstrap.sh created its four repositories with a bare `git init`, so the branch was whatever the host git defaulted to. Two tests built on that fixture name `main`, and fail wherever init.defaultBranch is unset and git still defaults to `master`: t9014-workspace-hub-flow.sh 0 of 2 passed t90010-workspace-git-compat.sh 5 of 7 passed t9014 broke in its setup, where `git checkout main` found no such pathspec and `bit hub pr create --base refs/heads/main` then reported "Target branch not found"; t90010 broke on `git push -u origin main`. Set HEAD while it is still unborn rather than passing `git init -b`, which needs git 2.28 — the script is otherwise plain POSIX sh with no version floor. Both tests now pass with init.defaultBranch unset, and the seven other tests on this fixture are unaffected: they never name a branch. Fixes #191 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDVUJHu38YtVAr6sKZtRDB
t/test-lib.sh removes TRASH_DIRECTORY only when the whole file passes, so every red run leaves one behind. Six of them accumulated while triaging the t900 failures (#193-#198), and untracked scratch repositories next to the tests are easy to commit by accident. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDVUJHu38YtVAr6sKZtRDB
This was referenced Sep 21, 2026
mizchi
pushed a commit
that referenced
this pull request
Sep 21, 2026
Three tests create their repositories with a bare `git init` and then name `main`, so they fail wherever init.defaultBranch is unset and git still defaults to `master` (git 2.43 here): t9001-subdir-push 19 of 23 passed `git push origin main` t9004-workspace-routing 7 of 8 passed `grep "main" branch.out` t9005-workspace-commit-push 6 of 7 passed `git push origin main` For t9001 and t9005 the branch to pin is the bare upstream's: the working clone adopts the remote's unborn HEAD, so setting it there fixes the push without touching the clone. t9004 creates its repository directly. Setting HEAD while it is unborn rather than passing `git init -b`, which needs git 2.28 — the same form used for the fixture in #192. All three now pass in full, both with init.defaultBranch unset and with it set to main, so the fix does not just move the dependency. Fixes #193 Fixes #194 Fixes #195 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDVUJHu38YtVAr6sKZtRDB
This was referenced Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #191.
Two small
t/hygiene changes.1. Pin the fixture's branch (#191)
fixtures/workspace_flow/bootstrap.shcreated its four repositories with a baregit init, so the branch was whatever the host git defaulted to. Two tests built on that fixture namemain, and fail whereverinit.defaultBranchis unset and git still defaults tomaster(git 2.43 here):t9014-workspace-hub-flow.sht90010-workspace-git-compat.sht9014 broke in its setup —
git checkout mainfound no such pathspec, andbit hub pr create --base refs/heads/mainthen reportedTarget branch not found. t90010 broke ongit push -u origin main.git init -q +git symbolic-ref HEAD refs/heads/main git config user.email "fixture@example.com"Setting HEAD while it is still unborn rather than passing
git init -b: the latter needs git 2.28, and the script is otherwise plain POSIXshwith no version floor.Verification
With
init.defaultBranchunset, all four repositories the fixture creates now reportrefs/heads/main, and every test built on it was run:The seven tests other than t9014 and t90010 never name a branch, and are unchanged either way.
Running the whole
test-subdirtask confirms one repair and no regression:2. Ignore the trash directories
t/test-lib.shremovesTRASH_DIRECTORYonly when the whole file passes, so every red run leaves one behind. Six accumulated while triaging the t900 failures, and untracked scratch repositories sitting next to the tests are easy to commit by accident.Verified by running a still-failing test and confirming
git statusstays clean.What this does not fix
Six tests in the
test-subdirtask are red onmainfor reasons unrelated to branch names, and stay red. I triaged each and filed them individually: #193, #194, #195, #196, #197, #198.They come down to two causes, not six:
git push origin mainon amasterrepo #193, part of t9004-workspace-routing:bit branchoutput is grepped formainon amasterrepo #194, t9005-workspace-commit-push: setup pushes tomainon amasterrepo #195;bit statusinside a workspace returns plain git status instead of the workspace form, while the explicitbit ws statusworks — t9004-workspace-routing:bit branchoutput is grepped formainon amasterrepo #194, t9007-workspace-nested-translation:repo statusfrom a nested path does not fail as a plain repo command #196, t9008-workspace-flow-cache: implicitbit statusafter a flow run does not show workspace status #197, t9009-workspace-flow-fixture: implicitbit statusin a fixture workspace does not show workspace status #198.This matters for the plan sketched in #190, where I suggested #191 was the blocker for wiring
t/into CI. It is not the only one; that wiring needs the six above resolved first.🤖 Generated with Claude Code
https://claude.ai/code/session_01VDVUJHu38YtVAr6sKZtRDB