aboutsummaryrefslogtreecommitdiffhomepage
path: root/githooks
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2021-08-07 08:08:56 +0900
committernsfisis <nsfisis@gmail.com>2021-08-07 08:08:56 +0900
commit9467096a7df53a62b640bcf22e3f824685ce7239 (patch)
tree41d56509b20e949623a3c2d85ddda82915f913be /githooks
parentad18d79f5295a7ff190bb52c168fd33e27a73636 (diff)
downloaddotfiles-9467096a7df53a62b640bcf22e3f824685ce7239.tar.gz
dotfiles-9467096a7df53a62b640bcf22e3f824685ce7239.tar.zst
dotfiles-9467096a7df53a62b640bcf22e3f824685ce7239.zip
Update 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 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