Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jul 28, 2015, 08:45 UTC
- Message-ID
- <vpqd1zc1xik.fsf@anie.imag.fr>
- In-Reply-To
- <1438066594-5620-2-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 21 quoted lines
> --- a/t/t6302-for-each-ref-filter.sh
> +++ b/t/t6302-for-each-ref-filter.sh
> @@ -133,4 +133,20 @@ test_expect_success 'reverse version sort' '
> test_cmp expect actual
> '
>
> +get_color ()
> +{
> + git config --get-color no.such.slot "$1"
> +}
> +
> +cat >expect <<EOF &&
> +$(get_color green)foo1.10$(get_color reset)||
> +$(get_color green)foo1.3$(get_color reset)||
> +$(get_color green)foo1.6$(get_color reset)||
> +EOF
> +
> +test_expect_success 'check `colornext` format option' '
> + git for-each-ref --format="%(colornext:green)%(refname:short)||" | grep "foo" >actual &&
> + test_cmp expect actual
> +'This is not a very good test: you're not checking that colornext applies to the next and only this one. Similarly to what I suggested for padright, I'd suggest
--format="%(refname:short)%(colornext:green)|%(refname:short)|%(refname:short)|"
-- Matthieu Moy http://www-verimag.imag.fr/~moy/