open-code-review/cmd
Jason Cat 27def8684b
Some checks are pending
CI / test (push) Waiting to run
CI / windows (push) Waiting to run
CI / cross-compile (amd64, darwin) (push) Waiting to run
CI / cross-compile (amd64, windows) (push) Waiting to run
CI / cross-compile (arm64, darwin) (push) Waiting to run
CI / cross-compile (arm64, linux) (push) Waiting to run
CI / cross-compile (arm64, windows) (push) Waiting to run
CodeQL Advanced / Analyze (go) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Pages / build (push) Waiting to run
Deploy Pages / deploy (push) Blocked by required conditions
plugin-contract / plugin-contract (push) Waiting to run
fix(scan): resolve --path like the filesystem and reject nonexistent paths (#1709)
* fix(scan): match --path selectors case-insensitively

On Windows and macOS a --path selector such as SRC names an existing directory (the filesystem resolves it), but filterByPaths compared selectors to git ls-files output byte-for-byte, so the scan silently selected no files and exited 0. Fold case like the other user-facing path filters (--include/--exclude, secret paths, the extension allowlist).

Refs #1708

* fix(scan): prefer the exact --path spelling before folding case

A selector now matches its own spelling first, so on a case-sensitive
filesystem --path src cannot widen to a sibling SRC/; case-insensitive
matching stays as a per-selector fallback, the repair for --path SRC on
Windows and macOS. Documented on the ocr scan page in all locales.

* fix(scan): resolve --path against the filesystem before folding case

A selector's own spelling is tried first; a spelling that names nothing
must resolve in the working tree before case folding applies, so on a
case-sensitive filesystem a wrongly-cased --path is an error instead of
a folded match or a silent empty scan. Docs updated in all locales.

* fix(scan): resolve --path selectors to their on-disk path

A selector that names nothing in its own spelling is resolved against
the working tree -- symlinks followed, on-disk case taken where the
filesystem folds it -- and only the resolved path is matched, replacing
the case-fold fallback. An empty src/docs/ therefore selects nothing on
a case-sensitive filesystem even while src/DOCS/ holds tracked files.

---------

Co-authored-by: Kite <254839944+lizhengfeng101@users.noreply.github.com>
2026-10-19 17:13:29 +08:00
..
opencodereview fix(scan): resolve --path like the filesystem and reject nonexistent paths (#1709) 2026-10-19 17:13:29 +08:00