test_must_be_empty stdout.actual
'
-test_expect_success 'git hook run: exit codes are passed along' '
- write_script .git/hooks/test-hook <<-EOF &&
- exit 1
- EOF
-
- test_expect_code 1 git hook run test-hook &&
-
- write_script .git/hooks/test-hook <<-EOF &&
- exit 2
- EOF
-
- test_expect_code 2 git hook run test-hook &&
-
- write_script .git/hooks/test-hook <<-EOF &&
- exit 128
- EOF
-
- test_expect_code 128 git hook run test-hook &&
-
- write_script .git/hooks/test-hook <<-EOF &&
- exit 129
- EOF
-
- test_expect_code 129 git hook run test-hook
-'
+for code in 1 2 128 129
+do
+ test_expect_success "git hook run: exit code $code is passed along" '
+ test_hook test-hook <<-EOF &&
+ exit $code
+ EOF
+
+ test_expect_code $code git hook run test-hook
+ '
+done
test_expect_success 'git hook run arg u ments without -- is not allowed' '
test_expect_code 129 git hook run test-hook arg u ments