Merge branch 'rs/external-diff-tempfile'
[alt-git.git] / t / t7520-ignored-hook-warning.sh
blobdc57526e6f1f7af741a4cd6c1ce4800563be5c37
1 #!/bin/sh
3 test_description='ignored hook warning'
5 . ./test-lib.sh
7 test_expect_success setup '
8 test_hook --setup pre-commit <<-\EOF
9 exit 0
10 EOF
13 test_expect_success 'no warning if hook is not ignored' '
14 git commit --allow-empty -m "more" 2>message &&
15 test_i18ngrep ! -e "hook was ignored" message
18 test_expect_success POSIXPERM 'warning if hook is ignored' '
19 test_hook --disable pre-commit &&
20 git commit --allow-empty -m "even more" 2>message &&
21 test_i18ngrep -e "hook was ignored" message
24 test_expect_success POSIXPERM 'no warning if advice.ignoredHook set to false' '
25 test_config advice.ignoredHook false &&
26 test_hook --disable pre-commit &&
27 git commit --allow-empty -m "even more" 2>message &&
28 test_i18ngrep ! -e "hook was ignored" message
31 test_expect_success 'no warning if unset advice.ignoredHook and hook removed' '
32 test_hook --remove pre-commit &&
33 test_unconfig advice.ignoredHook &&
34 git commit --allow-empty -m "even more" 2>message &&
35 test_i18ngrep ! -e "hook was ignored" message
38 test_done