* Resolve core.hooksPath relative to GIT_WORK_TREE
git supports relative values in core.hooksPath.
`man git-config`:
> A relative path is taken as relative to the directory where the hooks are
> run (see the "DESCRIPTION" section of githooks[5]).
`man githooks`:
> Before Git invokes a hook, it changes its working directory to either
> $GIT_DIR in a bare repository or the root of the working tree in a >
> non-bare repository.
I.e. relative paths in core.hooksPath in non-bare repositories are always
relative to GIT_WORK_TREE.
There is a further exception; I believe this is not considered for path
resolution:
> An exception are hooks triggered during a push (pre-receive, update,
> post-receive, post-update, push-to-checkout) which are always executed
> in $GIT_DIR.
* Favor Repository::workdir() over path().parent()
This more clearly errors in case of bare repositories instead of using
the parent directory of the bare repository.
---------
Co-authored-by: Naseschwarz <naseschwarz@0x53a.de>
Co-authored-by: extrawurst <776816+extrawurst@users.noreply.github.com>