From 22e8971a5bf96faedbfc39cf667d4f1b76141ba4 Mon Sep 17 00:00:00 2001 From: Zhihe Li Date: Thu, 7 Jul 2022 15:58:39 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Update=20git=20hook=20t?= =?UTF-8?q?o=20not=20use=20commitizen=20on=20merges=20(#1177)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/prepare-commit-msg | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg index ac49459f7..95f3f449c 100755 --- a/.husky/prepare-commit-msg +++ b/.husky/prepare-commit-msg @@ -1,5 +1,14 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +# Don't run commitizen for merge or squash commits +if [ "${COMMIT_SOURCE}" = merge ] || [ "${COMMIT_SOURCE}" = squash ];then + exit 0 +fi + # This is to allow interaction with the terminal for commitizen exec < /dev/tty && npx git-cz --hook || true