archive: improve support for running in subdirectory
[git/debian.git] / t / t7520-ignored-hook-warning.sh
blob184b2589893b78ef1e77521a6a9e7f0e5b514de9
1 #!/bin/sh
3 test_description='ignored hook warning'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success setup '
9 test_hook --setup pre-commit <<-\EOF
10 exit 0
11 EOF
14 test_expect_success 'no warning if hook is not ignored' '
15 git commit --allow-empty -m "more" 2>message &&
16 test_i18ngrep ! -e "hook was ignored" message
19 test_expect_success POSIXPERM 'warning if hook is ignored' '
20 test_hook --disable pre-commit &&
21 git commit --allow-empty -m "even more" 2>message &&
22 test_i18ngrep -e "hook was ignored" message
25 test_expect_success POSIXPERM 'no warning if advice.ignoredHook set to false' '
26 test_config advice.ignoredHook false &&
27 test_hook --disable pre-commit &&
28 git commit --allow-empty -m "even more" 2>message &&
29 test_i18ngrep ! -e "hook was ignored" message
32 test_expect_success 'no warning if unset advice.ignoredHook and hook removed' '
33 test_hook --remove pre-commit &&
34 test_unconfig advice.ignoredHook &&
35 git commit --allow-empty -m "even more" 2>message &&
36 test_i18ngrep ! -e "hook was ignored" message
39 test_done