From: Junio C Hamano Date: Tue, 30 Oct 2018 06:43:41 +0000 (+0900) Subject: Merge branch 'jk/run-command-notdot' X-Git-Tag: v2.20.0-rc0~124 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/17809a98f9b77b6295e06f54bbe500333171345a Merge branch 'jk/run-command-notdot' The implementation of run_command() API on the UNIX platforms had a bug that caused a command not on $PATH to be found in the current directory. * jk/run-command-notdot: run-command: mark path lookup errors with ENOENT --- 17809a98f9b77b6295e06f54bbe500333171345a diff --cc t/t0061-run-command.sh index 3e131c5325,b9cfc03a53..cf932c8514 --- a/t/t0061-run-command.sh +++ b/t/t0061-run-command.sh @@@ -11,8 -11,9 +11,8 @@@ cat >hello-script <<-EO #!$SHELL_PATH cat hello-script EOF ->empty - test_expect_success 'start_command reports ENOENT' ' + test_expect_success 'start_command reports ENOENT (slash)' ' test-tool run-command start-command-ENOENT ./does-not-exist ' @@@ -22,9 -27,16 +26,16 @@@ test_expect_success 'run_command can ru test-tool run-command run-command ./hello.sh >actual 2>err && test_cmp hello-script actual && - test_cmp empty err + test_must_be_empty err ' + test_expect_success 'run_command is restricted to PATH' ' + write_script should-not-run <<-\EOF && + echo yikes + EOF + test_must_fail test-tool run-command run-command should-not-run + ' + test_expect_success !MINGW 'run_command can run a script without a #! line' ' cat >hello <<-\EOF && cat hello-script