Prepare for 2.9.4
[alt-git.git] / t / t1350-config-hooks-path.sh
blob5e3fb3a6afec21d17c9ebe2567b42019f87bc7b1
1 #!/bin/sh
3 test_description='Test the core.hooksPath configuration variable'
5 . ./test-lib.sh
7 test_expect_success 'set up a pre-commit hook in core.hooksPath' '
8 mkdir -p .git/custom-hooks .git/hooks &&
9 write_script .git/custom-hooks/pre-commit <<-\EOF &&
10 echo CUSTOM >>actual
11 EOF
12 write_script .git/hooks/pre-commit <<-\EOF
13 echo NORMAL >>actual
14 EOF
17 test_expect_success 'Check that various forms of specifying core.hooksPath work' '
18 test_commit no_custom_hook &&
19 git config core.hooksPath .git/custom-hooks &&
20 test_commit have_custom_hook &&
21 git config core.hooksPath .git/custom-hooks/ &&
22 test_commit have_custom_hook_trailing_slash &&
23 git config core.hooksPath "$PWD/.git/custom-hooks" &&
24 test_commit have_custom_hook_abs_path &&
25 git config core.hooksPath "$PWD/.git/custom-hooks/" &&
26 test_commit have_custom_hook_abs_path_trailing_slash &&
27 cat >expect <<-\EOF &&
28 NORMAL
29 CUSTOM
30 CUSTOM
31 CUSTOM
32 CUSTOM
33 EOF
34 test_cmp expect actual
37 test_done