| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | . "$(dirname "$0")/testlib.sh" |
| 4 | |
| 5 | # These tests rely on behavior found in Git versions less than 2.9.0 to perform |
| 6 | # themselves, specifically: |
| 7 | # - lack of core.hooksPath support |
| 8 | ensure_git_version_isnt $VERSION_HIGHER "2.9.0" |
| 9 | |
| 10 | begin_test "install with unsupported core.hooksPath" |
| 11 | ( |
| 12 | set -e |
| 13 | |
| 14 | repo_name="unsupported-custom-hooks-path" |
| 15 | git init "$repo_name" |
| 16 | cd "$repo_name" |
| 17 | |
| 18 | hooks_dir="custom_hooks_dir" |
| 19 | mkdir -p "$hooks_dir" |
| 20 | |
| 21 | git config --local core.hooksPath "$hooks_dir" |
| 22 | |
| 23 | git lfs install 2>&1 | tee install.log |
| 24 | grep "Updated Git hooks" install.log |
| 25 | |
| 26 | [ ! -e "$hooks_dir/pre-push" ] |
| 27 | [ -e ".git/hooks/pre-push" ] |
| 28 | ) |
| 29 | end_test |