]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t0061: adjust to test-tool transition
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Oct 2018 02:41:09 +0000 (11:41 +0900)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Oct 2018 02:41:09 +0000 (11:41 +0900)
1  2 
run-command.c
t/t0061-run-command.sh

diff --cc run-command.c
index 84b883c2132bb07bc7fa21434368d64664587b8b,8d42a4f534f7ad0a1e06d5ce898b114253f06b18..d679cc267c39b9fb34f57078db5db12ed591b7e2
@@@ -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
index c887ed5b45e824d281343196c8781cbb6e85abed,0303ddbb6440f0f8ef8051f390447f9406694239..b9cfc03a53d9ef892b047df5a9d6a15fb0febf55
@@@ -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-run-command start-command-ENOENT does-not-exist
+ test_expect_success 'start_command reports ENOENT (no slash)' '
++      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 &&
        test_cmp empty err
  '
  
 -      test_must_fail test-run-command run-command should-not-run
+ 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