From c84de6d5ad5d26d080f774a5e9283a9d9b2576fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 23 Apr 2023 20:00:29 +0200 Subject: [PATCH] RVRNEXT-5 make prepare-commit-msg accept fixup commits --- scripts/gitHooks/prepare-commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gitHooks/prepare-commit-msg b/scripts/gitHooks/prepare-commit-msg index 6d109a7..716f326 100755 --- a/scripts/gitHooks/prepare-commit-msg +++ b/scripts/gitHooks/prepare-commit-msg @@ -7,7 +7,7 @@ if [[ "${BRANCH_NAME}" =~ $BRANCH_PATTERN ]]; then TICKET_ID=$(echo $BRANCH_NAME | sed -E "s@$BRANCH_PATTERN@\\2@") COMMIT_MESSAGE=$(head -n 1 $1) - COMMIT_MESSAGE_REGEX="^$TICKET_ID .*" + COMMIT_MESSAGE_REGEX="^(fixup! )?$TICKET_ID .*" if [[ ! "${COMMIT_MESSAGE}" =~ $COMMIT_MESSAGE_REGEX ]]; then sed -i.bak -e "1s/^/$TICKET_ID /" $1