Repository navigation
A worktree is a checkout - #53
Merged
Merged
Conversation
check_submodules gated on `[ -d "${STANDARDS_DIR}/.git" ]`. In a worktree
`.git` is a file holding a `gitdir:` pointer rather than a directory, so that
read answered "not a git repo" and the check passed by declaring there was
nothing to check.
A false clean is the one answer worse than a wrong finding, and this one was
load-bearing: the engine is routinely developed in a worktree — v0.58.0,
v0.59.0 and v0.59.1 were each built in one — so submodule drift in exactly the
place the last three releases were cut went unreported behind an `ok`.
`git rev-parse --git-dir` is true in a checkout, a worktree and a submodule
alike, which is the question being asked. The first run after the fix, in the
worktree it was written in, turned the false ok into a real "submodule not
initialized" warning.
The test builds its own sandbox repo and worktree rather than reading this
checkout, so the assertion does not depend on where the suite happens to run
from — and it asserts the fixture is really a worktree first, or it would pass
for the wrong reason.
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.
make doctorreportedokfor a question it never asked.In a worktree
.gitis a file holding agitdir:pointer, not a directory.So the guard read "not a git repo", the check returned, and it printed a pass.
A false clean is worse than a wrong finding, and this one sat in a load-
bearing place: the engine is routinely developed in a worktree — v0.58.0,
v0.59.0 and v0.59.1 were each built in one — so submodule drift in exactly the
checkouts the last three releases were cut from went unreported behind an
ok.That is not hypothetical. The first run after the fix, in the worktree the fix
was written in:
The submodule really was uninitialised, all day, in every worktree this week.
The fix
git rev-parse --git-dir, which is true in a checkout, a worktree and asubmodule alike — the question actually being asked, rather than a guess at
what a repo looks like on disk.
Testing
The test builds its own sandbox repo and worktree rather than reading this
checkout, so the assertion does not depend on where the suite happens to run
from. It asserts the fixture is really a worktree first —
.gitis a file, nota directory — or the whole thing would pass for the wrong reason.
Both new assertions confirmed failing against the pre-fix script:
The first of those is the assertion that has been failing in every worktree run
all week and passing in CI; it is fixed by the same change, which is what
identified the cause.
make lintclean.test-doctor.sh60 passed.🤖 Generated with Claude Code