Commit 3939f7c
Anchor a Loose File on Its Own Parent, Not on Where the Caller Stands
The no-repository fallback anchored a file argument on `.`, which is the
caller's directory. Scanning a loose file from inside an operational
repository therefore exempted it, which is this PR's own defect in
miniature, reintroduced by the fix for the previous round's regression.
A file now anchors on its own parent. A bare filename still anchors on `.`
and that stays correct, since `.` is the directory holding it.
The test meant to guard this passed a directory, so it never reached the
branch that broke. It passes the file now, with `operational_checkout`
mocked to treat `.` as operational, which is the arrangement that fails on
the old behaviour. A second case keeps the directory path covered.
Verified live as well: a loose file scanned from an operational checkout
reports the planted violation, and the multi-file invocation outside a
repository still exits 0.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 492957a commit 3939f7c
2 files changed
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1122 | 1122 | | |
1123 | 1123 | | |
1124 | 1124 | | |
1125 | | - | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1126 | 1128 | | |
1127 | 1129 | | |
1128 | 1130 | | |
1129 | 1131 | | |
1130 | | - | |
| 1132 | + | |
1131 | 1133 | | |
1132 | 1134 | | |
1133 | 1135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1881 | 1881 | | |
1882 | 1882 | | |
1883 | 1883 | | |
1884 | | - | |
| 1884 | + | |
1885 | 1885 | | |
1886 | 1886 | | |
1887 | | - | |
1888 | | - | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
1889 | 1891 | | |
1890 | 1892 | | |
1891 | 1893 | | |
1892 | 1894 | | |
1893 | 1895 | | |
| 1896 | + | |
1894 | 1897 | | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1895 | 1912 | | |
1896 | | - | |
1897 | 1913 | | |
1898 | 1914 | | |
1899 | 1915 | | |
| |||
0 commit comments