| test_description='pre-commit hook' |
| test_expect_success 'with no hook' ' |
| test_expect_success '--no-verify with no hook' ' |
| git commit --no-verify -m "bar" |
| # now install hook that always succeeds |
| HOOKDIR="$(git rev-parse --git-dir)/hooks" |
| HOOK="$HOOKDIR/pre-commit" |
| test_expect_success 'with succeeding hook' ' |
| test_expect_success '--no-verify with succeeding hook' ' |
| echo "even more" >> file && |
| git commit --no-verify -m "even more" |
| test_expect_success 'with failing hook' ' |
| echo "another" >> file && |
| test_must_fail git commit -m "another" |
| test_expect_success '--no-verify with failing hook' ' |
| git commit --no-verify -m "stuff" |
| test_expect_success POSIXPERM 'with non-executable hook' ' |
| echo "content" >> file && |
| test_expect_success POSIXPERM '--no-verify with non-executable hook' ' |
| echo "more content" >> file && |
| git commit --no-verify -m "more content" |