diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-08-07 08:08:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-08-07 08:08:56 +0900 |
| commit | 9467096a7df53a62b640bcf22e3f824685ce7239 (patch) | |
| tree | 41d56509b20e949623a3c2d85ddda82915f913be | |
| parent | ad18d79f5295a7ff190bb52c168fd33e27a73636 (diff) | |
| download | dotfiles-9467096a7df53a62b640bcf22e3f824685ce7239.tar.gz dotfiles-9467096a7df53a62b640bcf22e3f824685ce7239.tar.zst dotfiles-9467096a7df53a62b640bcf22e3f824685ce7239.zip | |
Update githooks/commit-msg: fix a way to extract issue number
| -rwxr-xr-x | githooks/commit-msg | 2 |
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 |
