Subject: Re: [PATCH 8/8] Fix tests breaking when checkout path contains shell metacharacters

From: Junio C Hamano <[email-masked]>
Date: Thu, 10 Apr 2008 00:24:29 -0700

Johannes Sixt <[email-masked]> writes:

>>>>  test_expect_success  ".rev_db auto-converted to .rev_map.UUID" "
>>>>  	git-svn fetch -i trunk &&
>>>> +	test -z \"\$(ls \"\$GIT_DIR\"/svn/trunk/.rev_db.* 2>/dev/null)\" &&
>>>> +	expect=\"\$(ls \"\$GIT_DIR\"/svn/trunk/.rev_map.*)\" &&
>>>>  	test -n \"\$expect\" &&
>>>> +	rev_db=\"\$(echo \$expect | sed -e 's,_map,_db,')\" &&
>>>> +	convert_to_rev_db \"\$expect\" \"\$rev_db\" &&
>>>> +	rm -f \"\$expect\" &&
>>>> +	test -f \"\$rev_db\" &&
>>>>  	git-svn fetch -i trunk &&
>>>> +	test -z \"\$(ls \"\$GIT_DIR\"/svn/trunk/.rev_db.* 2>/dev/null)\" &&
>>>> +	test ! -e \"\$GIT_DIR\"/svn/trunk/.rev_db &&
>>>> +	test -f \"\$expect\"
>>>>  	"
>>> While looking at this test: Wouldn't it be easier to just place the whole
>>> thing (and probably similar cases, too) in single-quotes?
>> 
>> To be honest, I fixed all the git-svn tests with a suitably clever vim s///
>> expression, so at the time this way was actually easier :)

Yeah, last night I ran out of energy reviewing things.  The above is
simply too ugly to be acceptable, with or without automated s///
expression.