Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f82f42e

Browse files
committed
Merge branch 'ignore-commit-types'
2 parents 11f9c58 + 2cc96a2 commit f82f42e

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

template/hooks/commit-msg

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ corrected=''
3535
ok=true
3636
line_count=0
3737
while IFS='' read -r line || [[ -n "$line" ]]; do
38-
if (( "$line_count" == 0 )) && (( "${#line}" > "$MAX_SUBJECT_LENGTH" )) && [[ "$line" != \#* ]]; then
39-
echo "error: the subject must be less than or equal to $MAX_SUBJECT_LENGTH characters" >&2
40-
exit 1
38+
if (( "$line_count" == 0 )) && [[ "$line" != \#* ]]; then
39+
if [[ "$line" == fixup\!* ]] || [[ "$line" == Merge* ]]; then
40+
exit 0
41+
elif (( "${#line}" > "$MAX_SUBJECT_LENGTH" )); then
42+
echo "error: the subject must be less than or equal to $MAX_SUBJECT_LENGTH characters" >&2
43+
exit 1
44+
fi
45+
corrected="$line\n"
46+
((line_count++))
4147
elif (( "$line_count" == 1 )) && (( "${#line}" > "0" )) && [[ "$line" != \#* ]]; then
4248
echo "error: the subject and body must be separated by a blank line" >&2
4349
exit 1

0 commit comments

Comments
 (0)