Re: [PATCH 4/4] t4200: avoid passing a non-newline terminated file to sed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt wrote:
> Brandon Casey schrieb:
>> Some versions of sed exit non-zero if the file they are supplied is not
>> newline terminated.  Solaris's /usr/xpg4/bin/sed is one such sed.  So
>> rework this test to avoid doing so.
>> ---
>>  t/t4200-rerere.sh |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
>> index b68ab11..48dbd8e 100755
>> --- a/t/t4200-rerere.sh
>> +++ b/t/t4200-rerere.sh
>> @@ -190,7 +190,7 @@ test_expect_success 'file2 added differently in two branches' '
>>  	git add file2 &&
>>  	git commit -m version2 &&
>>  	test_must_fail git merge fourth &&
>> -	sha1=$(sed -e "s/	.*//" .git/MERGE_RR) &&
>> +	sha1=$({ cat .git/MERGE_RR; echo; } | sed -e "s/	.*//") &&
> 
> Couldn't that line become
> 
> 	sha1=$(cat .git/MERGE_RR) &&
> 	sha1=%{sha1%%	*} &&
> 
> (a literal tab before the '*')?

Yes, that works here.  The line above has been removed so it's moot for
this case.  Your change could be applied at line 60 of t4200-rerere.sh to
replace my perl call that was just applied if you think it is worth it.

-brandon
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]