From: Matthieu Moy Date: Tue, 28 Jul 2015 08:45:07 GMT Subject: Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom Message-ID: In-Reply-To: <1438066594-5620-2-git-send-email-Karthik.188@gmail.com> Karthik Nayak writes: > --- 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 < +$(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/