From abc40004fd2715497d964ba3d38f7a702f22c3bf Mon Sep 17 00:00:00 2001 From: Thomas Wimmer Date: Sun, 10 Dec 2023 23:18:58 +0100 Subject: [PATCH] Fix the byte-compiler warning in a different way Since (magit-gitdir "hooks/commit-msg") returns nil instead of (magit-git-dir "hooks/commit-msg"), which returns the expected path, a working fix is to call magit-gitdir without any args and concat it with the hooks/commit-msg. Change-Id: I58a185bcc4805bf962372935be562843c778414c --- gerrit.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gerrit.el b/gerrit.el index f2fbfaf..87a69d3 100644 --- a/gerrit.el +++ b/gerrit.el @@ -336,7 +336,8 @@ This refspec is a string of the form \='refs/changes/xx/xx/x\='." (defun gerrit--ensure-commit-msg-hook-exists () "Create a commit-msg hook, if it doesn't exist." - (let ((hook-file (magit-git-dir "hooks/commit-msg"))) + (let ((hook-file + (concat (magit-gitdir) (convert-standard-filename "hooks/commit-msg")))) (unless (file-exists-p hook-file) (message "downloading commit-msg hook file") (url-copy-file