Re: [PATCH v5 03/11] ref-filter: add option to pad atoms to the right
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Jul 27, 2015, 12:50 UTC
- Message-ID
- <vpq3809aho9.fsf@anie.imag.fr>
- In-Reply-To
- <1437982035-6658-3-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 23 quoted lines
> --- a/t/t6302-for-each-ref-filter.sh > +++ b/t/t6302-for-each-ref-filter.sh > @@ -81,4 +81,20 @@ test_expect_success 'filtering with --contains' ' > test_cmp expect actual > ' > > +test_expect_success 'padding to the right using `padright`' ' > + cat >expect <<-\EOF && > + refs/heads/master | > + refs/heads/side | > + refs/odd/spot | > + refs/tags/double-tag | > + refs/tags/four | > + refs/tags/one | > + refs/tags/signed-tag | > + refs/tags/three | > + refs/tags/two | > + EOF > + git for-each-ref --format="%(padright:25)%(refname)|" >actual && > + test_cmp expect actual > +' > + > test_done
See my remark on previous patch: this test is not sufficient. You do not only need to check that %(padright) is taken into account, but you also need to check that it is taken into account for the right atom and only this one. I'd suggest
--format '%(refname)%(padright:25)|%(refname)|%(refname)|'
Only the middle column should be padded.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/