From aea302be6c3c323207502a973fe341c3bcf7288f Mon Sep 17 00:00:00 2001 From: "Thomas J. Fan" Date: Mon, 5 May 2025 13:55:32 -0400 Subject: [PATCH] Use git-path commit in hook (#17616) Signed-off-by: Thomas J. Fan --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5ecd7b70ea540..30a7430f05d69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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