summaryrefslogtreecommitdiff
path: root/t/t0061-run-command.sh
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-04-19 23:13:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-21 00:55:32 (GMT)
commitc2d3119d7bb2122a715d2adac1574514aeff7723 (patch)
tree71827fd722a1aa5ba0bd71f019d09c83ce78c3da /t/t0061-run-command.sh
parent1fd1a919ce9135a34866d5d13aed5312ea5e07f1 (diff)
downloadgit-c2d3119d7bb2122a715d2adac1574514aeff7723.zip
git-c2d3119d7bb2122a715d2adac1574514aeff7723.tar.gz
git-c2d3119d7bb2122a715d2adac1574514aeff7723.tar.bz2
t0061: run_command executes scripts without a #! line
Add a test to 't0061-run-command.sh' to ensure that run_command can continue to execute scripts which don't include a '#!' line. As shell scripts are not natively executable on Windows, we use a workaround to check "#!" when running scripts from Git. As this test requires the platform (not with Git's help) to run scripts without "#!", skipt it on Windows. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0061-run-command.sh')
-rwxr-xr-xt/t0061-run-command.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index 12228b4..98c09dd 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -26,6 +26,17 @@ test_expect_success 'run_command can run a command' '
test_cmp empty err
'
+test_expect_success !MINGW 'run_command can run a script without a #! line' '
+ cat >hello <<-\EOF &&
+ cat hello-script
+ EOF
+ chmod +x hello &&
+ test-run-command run-command ./hello >actual 2>err &&
+
+ test_cmp hello-script actual &&
+ test_cmp empty err
+'
+
test_expect_success POSIXPERM 'run_command reports EACCES' '
cat hello-script >hello.sh &&
chmod -x hello.sh &&