aboutsummaryrefslogtreecommitdiffhomepage
path: root/githooks
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2021-09-11 13:25:50 +0900
committernsfisis <nsfisis@gmail.com>2021-09-11 13:25:50 +0900
commitfc3b01082f4b367dad1b9e6ea257517d77af6915 (patch)
treed76354731134df61f5a5bad30934d588bb7b33c6 /githooks
parent9467096a7df53a62b640bcf22e3f824685ce7239 (diff)
downloaddotfiles-fc3b01082f4b367dad1b9e6ea257517d77af6915.tar.gz
dotfiles-fc3b01082f4b367dad1b9e6ea257517d77af6915.tar.zst
dotfiles-fc3b01082f4b367dad1b9e6ea257517d77af6915.zip
githooks/commit-msg: fix a way to extract issue number
Diffstat (limited to 'githooks')
-rwxr-xr-xgithooks/commit-msg2
1 files changed, 1 insertions, 1 deletions
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