Subject: Re: [PATCH] run-command: write full error message in die_child

From: Johannes Sixt <[email-masked]>
Date: Wed, 20 Apr 2011 09:42:30 +0200

Am 4/19/2011 9:05, schrieb Jonathan Nieder:
> diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
> index 10b26e4..be602fd 100755
> --- a/t/t0061-run-command.sh
> +++ b/t/t0061-run-command.sh
> @@ -7,8 +7,32 @@ test_description='Test run command'
>  
>  . ./test-lib.sh
>  
> +cat >hello-script <<-EOF
> +	#!$SHELL_PATH
> +	echo hello
> +EOF
> +>empty
> +

Unfortunately, on Windows, the bash spawnd by git converts LF to CRLF...

>  test_expect_success 'start_command reports ENOENT' '
>  	test-run-command start-command-ENOENT ./does-not-exist
>  '
>  
> +test_expect_success 'run_command can run a command' '
> +	echo hello >expect &&
> +	cat hello-script >hello.sh &&
> +	chmod +x hello.sh &&
> +	test-run-command run-command ./hello.sh >actual 2>err &&
> +
> +	test_cmp expect actual &&

... therefore, we fail here. Can we have this squashed in, because 'cat'
leaves LFs alone?

diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh
index be602fd..979b478 100755
--- a/t/t0061-run-command.sh
+++ b/t/t0061-run-command.sh
@@ -9,7 +9,7 @@ test_description='Test run command'
 
 cat >hello-script <<-EOF
 	#!$SHELL_PATH
-	echo hello
+	cat hello-script
 EOF
 >empty
 
@@ -18,12 +18,11 @@ test_expect_success 'start_command reports ENOENT' '
 '
 
 test_expect_success 'run_command can run a command' '
-	echo hello >expect &&
 	cat hello-script >hello.sh &&
 	chmod +x hello.sh &&
 	test-run-command run-command ./hello.sh >actual 2>err &&
 
-	test_cmp expect actual &&
+	test_cmp hello-script actual &&
 	test_cmp empty err
 '

> +test_expect_success POSIXPERM,SANITY 'run_command reports EACCES' '

Thanks for this detail (POSIXPERM). It's required. I did not check whether
SANITY is really needed; I trust you did.

-- Hannes