From: Junio C Hamano Date: Wed, 21 Nov 2018 13:57:50 +0000 (+0900) Subject: Merge branch 'jk/run-command-notdot' into maint X-Git-Tag: v2.19.2~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1bf5d99b12faad5c895e4807ee6485acddc453c3;p=thirdparty%2Fgit.git Merge branch 'jk/run-command-notdot' into maint 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 --- 1bf5d99b12faad5c895e4807ee6485acddc453c3 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