Skip to content

fix(fixtures): pin the workspace_flow branch to main, and ignore t/ trash directories - #192

Merged
mizchi merged 2 commits into
mainfrom
claude/modest-dirac-kceqee
Sep 20, 2026
Merged

mizchi merged 2 commits into
mainfrom
claude/modest-dirac-kceqee

Conversation

@mizchi

@mizchi mizchi commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Fixes #191.

Two small t/ hygiene changes.

1. Pin the fixture's branch (#191)

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 (git 2.43 here):

before after
t9014-workspace-hub-flow.sh 0 of 2 2 of 2
t90010-workspace-git-compat.sh 5 of 7 7 of 7

t9014 broke in its setup — 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.

 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 POSIX sh with no version floor.

Verification

With init.defaultBranch unset, all four repositories the fixture creates now report refs/heads/main, and every test built on it was run:

t9009   4/5   (1 pre-existing failure, see below)
t9011   4/4     t9015   4/4
t9012   5/5     t9016   7/7
t9013   5/5     t9017   6/6
t9014   2/2  ←  t9018   5/5
t90010  7/7  ←

The seven tests other than t9014 and t90010 never name a branch, and are unchanged either way.

Running the whole test-subdir task confirms one repair and no regression:

             passed  failed
before          4       7
after           5       6     (t90010 moved; nothing else changed)

2. Ignore the trash directories

t/test-lib.sh removes TRASH_DIRECTORY only 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 status stays clean.

What this does not fix

Six tests in the test-subdir task are red on main for 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:

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

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
@mizchi mizchi changed the title fix(fixtures): pin the workspace_flow branch to main fix(fixtures): pin the workspace_flow branch to main, and ignore t/ trash directories Sep 20, 2026
@mizchi
mizchi merged commit 5472401 into main Sep 20, 2026
22 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t9014 and t90010 fail wherever git's default branch is not main

2 participants