]> git.ipfire.org Git - thirdparty/git.git/blame - t/t7520-ignored-hook-warning.sh
Merge branch 'gc/branch-recurse-submodules-fix'
[thirdparty/git.git] / t / t7520-ignored-hook-warning.sh
CommitLineData
f805a00a
DM
1#!/bin/sh
2
3test_description='ignored hook warning'
4
5. ./test-lib.sh
6
7test_expect_success setup '
66865d12 8 test_hook --setup pre-commit <<-\EOF
f805a00a
DM
9 exit 0
10 EOF
11'
12
13test_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
16'
17
18test_expect_success POSIXPERM 'warning if hook is ignored' '
66865d12 19 test_hook --disable pre-commit &&
f805a00a
DM
20 git commit --allow-empty -m "even more" 2>message &&
21 test_i18ngrep -e "hook was ignored" message
22'
23
24test_expect_success POSIXPERM 'no warning if advice.ignoredHook set to false' '
25 test_config advice.ignoredHook false &&
66865d12 26 test_hook --disable pre-commit &&
f805a00a
DM
27 git commit --allow-empty -m "even more" 2>message &&
28 test_i18ngrep ! -e "hook was ignored" message
29'
30
31test_expect_success 'no warning if unset advice.ignoredHook and hook removed' '
66865d12 32 test_hook --remove pre-commit &&
f805a00a
DM
33 test_unconfig advice.ignoredHook &&
34 git commit --allow-empty -m "even more" 2>message &&
35 test_i18ngrep ! -e "hook was ignored" message
36'
37
38test_done