for-each-ref: avoid color leakage
commitdb64eb655b48ea2c635480c6cc992b0156817aeb
authorRamkumar Ramachandra <artagnon@gmail.com>
Mon, 18 Nov 2013 17:39:13 +0000 (18 23:09 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Nov 2013 18:14:15 +0000 (19 10:14 -0800)
tree87d42cabc931a0cc1419e5b1433d8da10540a9fc
parentfddb74c94777351d549b2ddaa36612c41b2176f1
for-each-ref: avoid color leakage

To make sure that an invocation like the following doesn't leak color,

  $ git for-each-ref --format='%(subject)%(color:green)'

auto-reset at the end of the format string when the last color token
seen in the format string isn't a color-reset.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/for-each-ref.c
t/t6300-for-each-ref.sh