Repository navigation
fix: refuse teardown when Git hides untracked files - #7909
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge. Reviews (4) · Last reviewed commit: "no-mistakes(document): Document hidden-u..." · Reviewed by Greptile |
Closes #7779
Review was single-family (Codex) by the owner's temporary choice.
Intent
ok same instructions i gave you before pick high value issues from scan, in all the repos you scanning and use codex only to close them
Context: this task is scan pick P1: upstream issue #7779 in kunchenguid/firstmate. Teardown can erase an unadded file when Git is configured with status.showUntrackedFiles=no. Triage contract class: restore. Scan notes for this pick:
Issue: #7779
Teardown can erase an unadded file when Git is configured with status.showUntrackedFiles=no.
A one-flag correction restores an explicit no-uncommitted-work guarantee.
Size S.
Contract class: restore.
Maintainer triage.
Evidence:
bin/fm-teardown.sh:2097still uses plainstatus --porcelain, while the post-return check at line 2076 requests all untracked files.Competing work: No exact issue reference in the final 1,820-open-PR index. The overlapping #6067 handles interrupted pool resets, and #7193 handles index flags. Neither targets the missing untracked-files flag. Maintainer triage explicitly distinguishes the hidden-untracked fixture in the former.
Closure test: In a scratch Git repository set status.showUntrackedFiles=no and create an unadded file. Drive the real teardown entry point with fake pool/backend commands. It must refuse before any return or removal, preserve the file and task metadata, and name the dirty state. A clean control still reaches the guarded return. Add to tests/fm-teardown.test.sh and run it through bin/fm-test-run.sh.
The owner approved fixing the scan's high-value picks upstream through PRs, written and reviewed by Codex only.
What Changed
status.showUntrackedFiles=no.Risk Assessment
✅ Low: The bounded flag correction restores hidden-untracked-file detection at the shared safety check, with behavioral regression coverage and a test-only synchronization change.
Testing
Both targeted suites passed, with live dirty/clean teardown CLI and state evidence retained; a separate baseline replay was blocked before execution by the cleanup guard.
Evidence: Teardown CLI output and preserved file state
Source: Teardown CLI output and preserved file state
Evidence: Targeted test runner output
Source: Targeted test runner output
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
Step was skipped.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-teardown.test.sh tests/fm-watcher-lock.test.shexited 0.Captured actual teardown output and independently checked the disposable fixtures’ Git configuration, unadded file bytes, metadata and return records.A separate baseline replay command was rejected before execution because its cleanup usedrm -f; it was not retried.Confirmed fixture cleanup, unchanged source worktree, and HEAD ba06d2875ea5eb95d2d641b3a3067dd86683c750.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.