]>
Commit | Line | Data |
---|---|---|
f805a00a DM |
1 | #!/bin/sh |
2 | ||
3 | test_description='ignored hook warning' | |
4 | ||
03267e86 | 5 | TEST_PASSES_SANITIZE_LEAK=true |
f805a00a DM |
6 | . ./test-lib.sh |
7 | ||
8 | test_expect_success setup ' | |
66865d12 | 9 | test_hook --setup pre-commit <<-\EOF |
f805a00a DM |
10 | exit 0 |
11 | EOF | |
12 | ' | |
13 | ||
14 | test_expect_success 'no warning if hook is not ignored' ' | |
15 | git commit --allow-empty -m "more" 2>message && | |
6789275d | 16 | test_grep ! -e "hook was ignored" message |
f805a00a DM |
17 | ' |
18 | ||
19 | test_expect_success POSIXPERM 'warning if hook is ignored' ' | |
66865d12 | 20 | test_hook --disable pre-commit && |
f805a00a | 21 | git commit --allow-empty -m "even more" 2>message && |
6789275d | 22 | test_grep -e "hook was ignored" message |
f805a00a DM |
23 | ' |
24 | ||
25 | test_expect_success POSIXPERM 'no warning if advice.ignoredHook set to false' ' | |
26 | test_config advice.ignoredHook false && | |
66865d12 | 27 | test_hook --disable pre-commit && |
f805a00a | 28 | git commit --allow-empty -m "even more" 2>message && |
6789275d | 29 | test_grep ! -e "hook was ignored" message |
f805a00a DM |
30 | ' |
31 | ||
32 | test_expect_success 'no warning if unset advice.ignoredHook and hook removed' ' | |
66865d12 | 33 | test_hook --remove pre-commit && |
f805a00a DM |
34 | test_unconfig advice.ignoredHook && |
35 | git commit --allow-empty -m "even more" 2>message && | |
6789275d | 36 | test_grep ! -e "hook was ignored" message |
f805a00a DM |
37 | ' |
38 | ||
39 | test_done |