diff options
| author | Jim Porter | 2023-05-01 09:49:39 -0700 |
|---|---|---|
| committer | Jim Porter | 2023-05-01 09:51:56 -0700 |
| commit | d01543f1147b3514fd06ffcdf4be64a6cabe0018 (patch) | |
| tree | 25d1f114ef4bc74375670bb82ec098399417d33b | |
| parent | aa135e09b6735cd50742b1023fc901feb32e6a52 (diff) | |
| download | emacs-d01543f1147b3514fd06ffcdf4be64a6cabe0018.tar.gz emacs-d01543f1147b3514fd06ffcdf4be64a6cabe0018.zip | |
; Use $GIT_DIR to find the .git directory inside our hooks
This resolves an issue with running the hooks from a worktree. See
<https://lists.gnu.org/archive/html/emacs-devel/2023-05/msg00000.html>.
* build-aux/git-hooks/post-commit:
* build-aux/git-hooks/pre-push: Use $GIT_DIR.
| -rwxr-xr-x | build-aux/git-hooks/post-commit | 2 | ||||
| -rwxr-xr-x | build-aux/git-hooks/pre-push | 2 |
2 files changed, 2 insertions, 2 deletions
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 | |||
| 42 | fi | 42 | fi |
| 43 | 43 | ||
| 44 | git rev-parse HEAD | $awk -v reason=post-commit \ | 44 | git rev-parse HEAD | $awk -v reason=post-commit \ |
| 45 | -f .git/hooks/commit-msg-files.awk | 45 | -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" ' | |||
| 83 | # Print every SHA after oldref, up to (and including) newref. | 83 | # Print every SHA after oldref, up to (and including) newref. |
| 84 | system("git rev-list --first-parent --reverse " oldref ".." newref) | 84 | system("git rev-list --first-parent --reverse " oldref ".." newref) |
| 85 | } | 85 | } |
| 86 | ' | $awk -v reason=pre-push -f .git/hooks/commit-msg-files.awk | 86 | ' | $awk -v reason=pre-push -f ${GIT_DIR:-.git}/hooks/commit-msg-files.awk |