From d01543f1147b3514fd06ffcdf4be64a6cabe0018 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Mon, 1 May 2023 09:49:39 -0700 Subject: ; Use $GIT_DIR to find the .git directory inside our hooks This resolves an issue with running the hooks from a worktree. See . * build-aux/git-hooks/post-commit: * build-aux/git-hooks/pre-push: Use $GIT_DIR. --- build-aux/git-hooks/post-commit | 2 +- build-aux/git-hooks/pre-push | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'build-aux') diff --git a/build-aux/git-hooks/post-commit b/build-aux/git-hooks/post-commit index 68d9995d915..05f2d778b5c 100755 --- a/build-aux/git-hooks/post-commit +++ b/build-aux/git-hooks/post-commit @@ -42,4 +42,4 @@ else fi git rev-parse HEAD | $awk -v reason=post-commit \ - -f .git/hooks/commit-msg-files.awk + -f ${GIT_DIR:-.git}/hooks/commit-msg-files.awk diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push index 8e8277cba4f..6ff59102fd7 100755 --- a/build-aux/git-hooks/pre-push +++ b/build-aux/git-hooks/pre-push @@ -83,4 +83,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/hooks/commit-msg-files.awk +' | $awk -v reason=pre-push -f ${GIT_DIR:-.git}/hooks/commit-msg-files.awk -- cgit v1.2.1