3 test_description='ignored hook warning'
7 test_expect_success setup '
8 hookdir="$(git rev-parse --git-dir)/hooks" &&
9 hook="$hookdir/pre-commit" &&
10 mkdir -p "$hookdir" &&
11 write_script "$hook" <<-\EOF
16 test_expect_success 'no warning if hook is not ignored' '
17 git commit --allow-empty -m "more" 2>message &&
18 test_i18ngrep ! -e "hook was ignored" message
21 test_expect_success POSIXPERM 'warning if hook is ignored' '
23 git commit --allow-empty -m "even more" 2>message &&
24 test_i18ngrep -e "hook was ignored" message
27 test_expect_success POSIXPERM 'no warning if advice.ignoredHook set to false' '
28 test_config advice.ignoredHook false &&
30 git commit --allow-empty -m "even more" 2>message &&
31 test_i18ngrep ! -e "hook was ignored" message
34 test_expect_success 'no warning if unset advice.ignoredHook and hook removed' '
36 test_unconfig advice.ignoredHook &&
37 git commit --allow-empty -m "even more" 2>message &&
38 test_i18ngrep ! -e "hook was ignored" message