From: Junio C Hamano Date: Thu, 25 Oct 2018 02:41:09 +0000 (+0900) Subject: t0061: adjust to test-tool transition X-Git-Tag: v2.20.0-rc0~124^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f67b980771b8cda5fc2093aef6dbec5d7210dcab;p=thirdparty%2Fgit.git t0061: adjust to test-tool transition --- f67b980771b8cda5fc2093aef6dbec5d7210dcab diff --cc run-command.c index 84b883c213,8d42a4f534..d679cc267c --- a/run-command.c +++ b/run-command.c @@@ -380,10 -378,10 +380,10 @@@ static void child_err_spew(struct child set_error_routine(old_errfn); } - static void prepare_cmd(struct argv_array *out, const struct child_process *cmd) + static int prepare_cmd(struct argv_array *out, const struct child_process *cmd) { if (!cmd->argv[0]) - die("BUG: command is empty"); + BUG("command is empty"); /* * Add SHELL_PATH so in the event exec fails with ENOEXEC we can diff --cc t/t0061-run-command.sh index c887ed5b45,0303ddbb64..b9cfc03a53 --- a/t/t0061-run-command.sh +++ b/t/t0061-run-command.sh @@@ -13,10 -13,14 +13,14 @@@ cat >hello-script <<-EO EOF >empty - test_expect_success 'start_command reports ENOENT' ' + test_expect_success 'start_command reports ENOENT (slash)' ' - test-run-command start-command-ENOENT ./does-not-exist + test-tool run-command start-command-ENOENT ./does-not-exist ' + test_expect_success 'start_command reports ENOENT (no slash)' ' - test-run-command start-command-ENOENT does-not-exist ++ test-tool run-command start-command-ENOENT does-not-exist + ' + test_expect_success 'run_command can run a command' ' cat hello-script >hello.sh && chmod +x hello.sh && @@@ -26,6 -30,13 +30,13 @@@ test_cmp empty err ' + test_expect_success 'run_command is restricted to PATH' ' + write_script should-not-run <<-\EOF && + echo yikes + EOF - test_must_fail test-run-command run-command should-not-run ++ 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