If core.hooksPath is a relative path, git branchless init always resolves it relative to the directory in which it was invoked, not relative to the root of the repo like how Git interprets it.
Reproduction:
git init
git config core.hooksPath hooks
mkdir foo
cd foo
git branchless init
ls
Expected behavior
Hooks should have been installed to /hooks in the repo
Actual behavior
Hooks are installed to /foo/hooks (and then ignored by git)
Thanks for reporting. I think many git-branchless commands haven't been tested in non-root directories (and actually don't work), and so far it hasn't come up often (at least on the issue tracker).
Description of the bug
If
core.hooksPath
is a relative path,git branchless init
always resolves it relative to the directory in which it was invoked, not relative to the root of the repo like how Git interprets it.Reproduction:
Expected behavior
Hooks should have been installed to
/hooks
in the repoActual behavior
Hooks are installed to
/foo/hooks
(and then ignored by git)Version of
rustc
No response
Automated bug report
No response
Version of
git-branchless
git-branchless-opts 0.10.0
Version of
git
git version 2.39.5 (Apple Git-154)