Skip to content

Commit c2d3119

Browse files
bmwillgitster
authored andcommitted
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>
1 parent 1fd1a91 commit c2d3119

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

t/t0061-run-command.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ test_expect_success 'run_command can run a command' '
2626
test_cmp empty err
2727
'
2828

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+
2940
test_expect_success POSIXPERM 'run_command reports EACCES' '
3041
cat hello-script >hello.sh &&
3142
chmod -x hello.sh &&

0 commit comments

Comments
 (0)