Skip to content

Commit 45255be

Browse files
committed
Add test for verbose commit cut line marker
Because: * `git commit -v` uses the cut line marker to show the diff that would be commited at the bottom of the commit message. Anything after the cut line will not be included in the commit message. * `git-good-commit` should therefore ignore these lines when validating the commit message. * This functionality was added by #26 without a test.
1 parent e293416 commit 45255be

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/validation.bats

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ EOF
3535
assert_success
3636
}
3737

38+
@test "validation: ignores lines after the verbose cut line" {
39+
echo "n" > $FAKE_TTY
40+
run git commit -m "$(cat <<EOF
41+
Add foo bar string to my_file
42+
43+
# ------------------------ >8 ------------------------
44+
A line in the body that runs to longer than 72 characters after the verbose cut line
45+
EOF
46+
)"
47+
48+
assert_success
49+
}
50+
51+
3852
# 0. Good commits - control
3953
# ------------------------------------------------------------------------------
4054

0 commit comments

Comments
 (0)