fix(dev-setup): quote the hook path, read core.hooksPath NUL-safely and lift an empty value
The repository path is shell-quoted (printf %q) where it is written into the installed hooks, so a path with spaces, quotes or $(...) is data. The local core.hooksPath values are read with -z and compared and restored element by element, so a value with a newline survives; the loop avoids mapfile. Any local value, including an empty or trailing empty one, is lifted for the install and restored. tests/scripts/test_dev_setup.py covers it with stub tools in throwaway repositories, and lint.yml now runs tests/scripts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
74a5a0739b
commit
72e9813394
4 files changed
+315
-33
No files matched your search
@@ -1,4 +1,6 @@
|
||||
trivial:
|
||||
- >-
|
||||
scripts/dev-setup.sh checks for Python 3.11 or newer (KAMINO_PYTHON selects one), derives the repository from its own location, rebuilds an older
|
||||
virtualenv, and fails early when core.hooksPath is set or the hooks are missing.
|
||||
virtualenv, shell-quotes the repository path it writes into the installed hooks, lifts a repo-local core.hooksPath that points at this
|
||||
repository's own hooks (including a multi-valued, empty or newline-containing one) for the install and restores it exactly, and fails early
|
||||
only when core.hooksPath points elsewhere or is set outside the repository's config (a global value), or when the hooks are missing.
|
||||
Reference in new issue
Block a user