From 9467096a7df53a62b640bcf22e3f824685ce7239 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 7 Aug 2021 08:08:56 +0900 Subject: Update githooks/commit-msg: fix a way to extract issue number --- githooks/commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'githooks/commit-msg') diff --git a/githooks/commit-msg b/githooks/commit-msg index 5f2561d..b0c7e5b 100755 --- a/githooks/commit-msg +++ b/githooks/commit-msg @@ -125,7 +125,7 @@ if [[ -z ${gitbranch} ]]; then fi # Extract issue number from branch name. -local issue_number="${gitbranch##feature/}" +local issue_number="$(echo "${gitbranch}" | grep -o '[0-9][0-9]*')" if [[ -z ${issue_number} ]]; then # Failed to extract. Leave the commit message as it is. return 0 -- cgit v1.2.3-70-g09d2