From fc3b01082f4b367dad1b9e6ea257517d77af6915 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 11 Sep 2021 13:25:50 +0900 Subject: githooks/commit-msg: fix a way to extract issue number --- githooks/commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'githooks') diff --git a/githooks/commit-msg b/githooks/commit-msg index b0c7e5b..61c2844 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="$(echo "${gitbranch}" | grep -o '[0-9][0-9]*')" +local issue_number="$(echo "${gitbranch}" | grep -o '[0-9][0-9]*' | head -1)" if [[ -z ${issue_number} ]]; then # Failed to extract. Leave the commit message as it is. return 0 -- cgit v1.2.3-70-g09d2