A test in go test ./... commits staged files into the real checkout #866
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#866
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
While I worked on a branch, a
go test ./... -count=1run made a real commit,feat: x, in the worktree it ran in. The commit held the one file that was staged at that moment,internal/mdstripper/LICENSE. The author was the checkout's own git identity.With nothing staged, the same leak is silent: the stray commit has nothing to commit, so it fails with "nothing to commit" and the run stays green. So the leak shows only when the index holds staged files.
The hermetic test guard (ADR 0022) has a git-mutation half: under
go test, service-layer repo discovery refuses a worktree root that is not under the OS temp dir, so a mutating service op fails before it writes. This commit landed in a worktree outside the temp dir, so some path reached git without that guard.What I know
feat: xmatches the test titles ininternal/service/workflow/finish_agit_test.go(lines 407, 504, and 538). Those are the likely source, but I have not proven it.internal/service/gitandinternal/cmd/gitstub their commit step, so they are less likely.Acceptance criteria
go test ./...creates a commit, moves HEAD, or changes the index of the checkout that runs the suite. It runs with a staged file in the index, so the leak cannot hide.go test ./... -count=1leaves HEAD and the index unchanged.