Skip to content

Commit

Permalink
Fix the byte-compiler warning in a different way
Browse files Browse the repository at this point in the history
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
  • Loading branch information
twmr committed Dec 10, 2023
1 parent e825b52 commit abc4000
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gerrit.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abc4000

Please sign in to comment.