fix(hooks): drop basename from commit-msg

The hook parsed the message path with basename, an external command. Where
it is missing from PATH the substitution yields an empty string, set -e does
not trip on it, and the MERGE_MSG guard silently stops working — a generated
merge commit would then be rejected for missing trailers it cannot have.

POSIX parameter expansion needs no external command and behaves the same in
sh, dash, bash and Git Bash.

Issue: #116
User-Visible: no
This commit is contained in:
Matysh
2026-08-13 12:09:02 +03:00
parent b9062c1740
commit 05b38e67c4
Executable → Regular
+1 -1
View File
@@ -5,7 +5,7 @@ message_file=$1
# Git-generated merge commits do not represent an independently authored
# product change and inherit provenance from their parents.
case "$(basename "$message_file")" in
case "${message_file##*/}" in
MERGE_MSG) exit 0 ;;
esac