Re: [RFC/PATCH] tests: add initial bash completion tests
Junio C Hamano <gitster@pobox.com> writes:
Show 16 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> What about this instead?
>>
>> #!/bin/sh
>>
>> if type bash >/dev/null 2>&1
>> then
>> # execute inside bash
>> [ -z "$BASH" ] && exec bash $0
>> else
>> echo '1..0 #SKIP skipping bash completion tests; bash not available'
>> exit 0
>> fi
> ...
> Other than that, it is very much simple and straight-forward. I like it.
It probably is even simpler to do it like this.
if test -z "$BASH" && ! exec bash "$0" "$@"
then
echo '1..0 #SKIP...'
exit 0
fi... rest of the test starting with ". ./test-lib.sh" ...