| test_description='verbose commit template' |
| cat >check-for-diff <<EOF |
| exec grep '^diff --git' "\$1" |
| test_set_editor "$PWD/check-for-diff" |
| test_expect_success 'setup' ' |
| test_expect_success 'initial commit shows verbose diff' ' |
| test_expect_success 'second commit' ' |
| echo content modified >file && |
| git log -1 --pretty=format:%s%n%n%b >actual && |
| test_expect_success 'verbose diff is stripped out' ' |
| test_expect_success 'verbose diff is stripped out (mnemonicprefix)' ' |
| git config diff.mnemonicprefix true && |
| This is an example commit message that contains a diff. |
| test_expect_success 'diff in message is retained without -v' ' |
| git commit --amend -F diff && |
| test_expect_failure 'diff in message is retained with -v' ' |
| git commit --amend -F diff -v && |