Repository navigation
Conversation
…ree, so a run from a subfolder checks the whole repository The default mode ran `git ls-files` in the current folder, which lists only that subtree: from `sub/`, a game file in `other/` passed with exit 0. tracked_files() now asks `git rev-parse --show-toplevel` and lists from there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d9200bb708d5176a3525ba903f5ca364af17a7ae)
devnull34
left a comment
There was a problem hiding this comment.
Verified via Tier 2 Free Cloud (Groq gpt-oss-120b) & local test execution: Asking git rev-parse --show-toplevel in tracked_files() ensures running check_no_game_data from a subfolder inspects all tracked files across the entire worktree rather than omitting siblings in parallel directories. All 9 tests in test_check_no_game_data.py pass cleanly.
|
Confirmed independently on Windows 11 (CPython 3.14.3). Negative control on
|
|
Tested Test Suite Execution
Negative Control
Hygiene
AI-assisted review. |
|
Tested
|
|
✅ Automated security review: CLEAN (commit
Scope: static analysis of added diff lines only; no code was executed. Please review findings manually. |
|
Tested
For whoever merges: this composes with our open #8090, which turns the default-mode call outside a checkout into one error line; the merge is clean in either order, and #8090 first keeps the new git invocation's failure path one line. Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting. |
Claimed in the coordination issue as: #8047 (comment)
Depends on: none. #8090, #6396 and #6079 also edit
scripts/check_no_game_data.py, but they rewrite thepaths = argv or tracked_files(os.getcwd())line inmain(). This PR only changes the body oftracked_files(), so it should merge cleanly next to any of them.What and why
With no arguments,
check_no_game_data.pyrangit ls-files -zin the current folder. Git lists only that subtree there, so a run from a subfolder skipped the rest of the repository and exited 0 even with game data elsewhere.Repro (synthetic, no game files): a git repo with
other/x.binstarting withDDSandsub/a.txt, both added.other\x.bin: DDS texture, exit 1 (correct)sub/: no output, exit 0 (before);..\other\x.bin: DDS texture, exit 1 (after)tracked_files()now asksgit rev-parse --show-toplevel(newline stripped,normpathfor the/separators on Windows), runsgit ls-files -zfrom there and returns absolute paths, as before. Error handling is unchanged: outside a git checkout it still ends in the sameCalledProcessError, now fromrev-parseinstead ofls-files(#8090 turns that into one error line).New test
test_default_mode_from_a_subfolder_checks_the_whole_repository: it fails onmain(0 != 1) and passes with this change.Tested
Windows 11, CPython 3.13.14, CPU only (no GPU or driver involved), on
maindde82f27e:python -I tests/test_check_no_game_data.py: 9 OK (8 onmain, plus the new test).python -I tests/test_no_game_data_workflow.py(3 OK),python -I tests/test_ci_registration.py(14 OK),python -m compileall -q scripts tests,git diff --check: pass.python -I scripts/check_no_game_data.pyfrom the top level and fromscripts/: exit 0, and both list the same 2,273 tracked files.tests/test_tool_stdout_encoding.pyandtests/test_text_write_line_endings.pyfail the same way onmain; this change does not touch them.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code