Use git-path commit in hook (#17616)

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
This commit is contained in:
Thomas J. Fan 2025-05-05 13:55:32 -04:00 committed by GitHub
parent cc05b90d86
commit aea302be6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -101,8 +101,8 @@ repos:
args:
- -c
- |
if ! grep -q "^Signed-off-by: $(git config user.name) <$(git config user.email)>" .git/COMMIT_EDITMSG; then
printf "\nSigned-off-by: $(git config user.name) <$(git config user.email)>\n" >> .git/COMMIT_EDITMSG
if ! grep -q "^Signed-off-by: $(git config user.name) <$(git config user.email)>" "$(git rev-parse --git-path COMMIT_EDITMSG)"; then
printf "\nSigned-off-by: $(git config user.name) <$(git config user.email)>\n" >> "$(git rev-parse --git-path COMMIT_EDITMSG)"
fi
language: system
verbose: true