3 test_description='verbose commit template'
6 cat >check-for-diff <<EOF
8 exec grep '^diff --git' "\$1"
10 chmod +x check-for-diff
11 test_set_editor "$PWD/check-for-diff"
19 test_expect_success 'setup' '
25 test_expect_failure 'initial commit shows verbose diff' '
29 test_expect_success 'second commit' '
30 echo content modified >file &&
36 git log -1 --pretty=format:%s%n%n%b >actual &&
40 test_expect_success 'verbose diff is stripped out' '
41 git commit --amend -v &&
45 test_expect_success 'verbose diff is stripped out (mnemonicprefix)' '
46 git config diff.mnemonicprefix true &&
47 git commit --amend -v &&
52 This is an example commit message that contains a diff.
54 diff --git c/file i/file
56 index 0000000..f95c11d
63 test_expect_success 'diff in message is retained without -v' '
64 git commit --amend -F diff &&
68 test_expect_failure 'diff in message is retained with -v' '
69 git commit --amend -F diff -v &&