1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

; Fix post-commit and pre-push hooks in worktrees again

* build-aux/git-hooks/post-commit:
* build-aux/git-hooks/pre-push: Use "$(dirname $0)" to get the hooks
directory.
This commit is contained in:
Jim Porter 2023-05-04 09:22:40 -07:00
parent b28d44d422
commit d3ec68f5e4
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,8 @@
### Code:
HOOKS_DIR=$(dirname $0)
# Prefer gawk if available, as it handles NUL bytes properly.
if type gawk >/dev/null 2>&1; then
awk="gawk"
@ -42,4 +44,4 @@ else
fi
git rev-parse HEAD | $awk -v reason=post-commit \
-f ${GIT_DIR:-.git}/hooks/commit-msg-files.awk
-f $HOOKS_DIR/commit-msg-files.awk

View File

@ -31,6 +31,8 @@
### Code:
HOOKS_DIR=$(dirname $0)
# Prefer gawk if available, as it handles NUL bytes properly.
if type gawk >/dev/null 2>&1; then
awk="gawk"
@ -83,4 +85,4 @@ $awk -v origin_name="$1" '
# Print every SHA after oldref, up to (and including) newref.
system("git rev-list --first-parent --reverse " oldref ".." newref)
}
' | $awk -v reason=pre-push -f ${GIT_DIR:-.git}/hooks/commit-msg-files.awk
' | $awk -v reason=pre-push -f $HOOKS_DIR/commit-msg-files.awk