Closed
Description
Summary
I was trying to set-up a development environment to add a lint. I set up the git hook, and defined the lint. When I tried to commit the intermediate results, the git hook failed.
Reproducer
I tried this code:
cargo dev new_lint --name=needless_path_new --pass=late
cargo dev setup git-hook
git add .
git commit -m "cargo dev new_lint"
I expected to see this happen:
successful commit
Instead, this happened:
fatal: pathspec 'clippy_lints/src/lib.*.rs' did not match any files
This is what the output of git diff
looked like after I ran git add .
:
Changes to be committed:
modified: CHANGELOG.md
modified: clippy_lints/src/declared_lints.rs
modified: clippy_lints/src/lib.rs
new file: clippy_lints/src/needless_path_new.rs
new file: tests/ui/needless_path_new.rs
so it seems like the pathspec was trying to match the third path, but failed because of the extra .
either before or after the *
Version
rustc 1.88.0-nightly (d6c1e454a 2025-04-21)
binary: rustc
commit-hash: d6c1e454aa8af5e7e59fbf5c4e7d3128d2f99582
commit-date: 2025-04-21
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2
Additional Labels
No response