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>
Brandon Williams committed
Apr 19, 2017 at 16:13 UTC
c2d3119d7bb2122a715d2adac1574514aeff7723
1 file changed
+11
t/t0061-run-command.sh
+11
@@ -26,6 +26,17 @@ test_expect_success 'run_command can run a command' '
26
test_cmp empty err
27
'
28
29
+test_expect_success !MINGW 'run_command can run a script without a #! line' '
30
+ cat >hello <<-\EOF &&
31
+ cat hello-script
32
+ EOF
33
+ chmod +x hello &&
34
+ test-run-command run-command ./hello >actual 2>err &&
35
+
36
+ test_cmp hello-script actual &&
37
+ test_cmp empty err
38
+'
39
+
40
test_expect_success POSIXPERM 'run_command reports EACCES' '
41
cat hello-script >hello.sh &&
42
chmod -x hello.sh &&