(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'test_description='> name:test_description) op: assign_op.Equal rhs: {(SQ <'Test the core.hooksPath configuration variable'>)} spids: [4] ) ] redirects: [] ) (C {<.>} {<'./test-lib.sh'>}) (C {<test_expect_success>} {(SQ <'set up a pre-commit hook in core.hooksPath'>)} { (SQ <'\n'> <'\tmkdir -p .git/custom-hooks .git/hooks &&\n'> <'\twrite_script .git/custom-hooks/pre-commit <<-\\EOF &&\n'> <'\techo CUSTOM >>actual\n'> <'\tEOF\n'> <'\twrite_script .git/hooks/pre-commit <<-\\EOF\n'> <'\techo NORMAL >>actual\n'> <'\tEOF\n'> ) } ) (C {<test_expect_success>} {(SQ <'Check that various forms of specifying core.hooksPath work'>)} { (SQ <'\n'> <'\ttest_commit no_custom_hook &&\n'> <'\tgit config core.hooksPath .git/custom-hooks &&\n'> <'\ttest_commit have_custom_hook &&\n'> <'\tgit config core.hooksPath .git/custom-hooks/ &&\n'> <'\ttest_commit have_custom_hook_trailing_slash &&\n'> <'\tgit config core.hooksPath "$PWD/.git/custom-hooks" &&\n'> <'\ttest_commit have_custom_hook_abs_path &&\n'> <'\tgit config core.hooksPath "$PWD/.git/custom-hooks/" &&\n'> <'\ttest_commit have_custom_hook_abs_path_trailing_slash &&\n'> <'\tcat >expect <<-\\EOF &&\n'> <'\tNORMAL\n'> <'\tCUSTOM\n'> <'\tCUSTOM\n'> <'\tCUSTOM\n'> <'\tCUSTOM\n'> <'\tEOF\n'> <'\ttest_cmp expect actual\n'> ) } ) (C {<test_expect_success>} {(SQ <'git rev-parse --git-path hooks'>)} { (SQ <'\n'> <'\tgit config core.hooksPath .git/custom-hooks &&\n'> <'\tgit rev-parse --git-path hooks/abc >actual &&\n'> <'\ttest .git/custom-hooks/abc = "$(cat actual)"\n'> ) } ) (C {<test_done>}) ] )