Skip to content

Commit

Permalink
Merge pull request #2127 from zowe/fix/git-hook-worktrees
Browse files Browse the repository at this point in the history
[v2] Fix pre-commit script to support Git worktrees
  • Loading branch information
t1m0thyj authored May 2, 2024
2 parents 0a961e2 + 18cf124 commit 65d4aa9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. "$(dirname "$0")/_/husky.sh"

# If not a merge commit, require commit to be signed off
if [ ! -e .git/MERGE_MSG ] && ! grep -q "^Signed-off-by: " "$1"; then
if [ ! -e $(git rev-parse --git-dir)/MERGE_MSG ] && ! grep -q "^Signed-off-by: " "$1"; then
echo >&2 "Commit message must be signed off with your user name and email."
echo >&2 "To sign off your commit, add the -s flag to the git commit command."
exit 1
Expand Down

0 comments on commit 65d4aa9

Please sign in to comment.