describe: --match=<pattern> must limit the refs even when used with --all
commit46e1d6eb4dcdd2952149fae214aeaa32f29c8df5
authorJunio C Hamano <gitster@pobox.com>
Thu, 28 Feb 2013 21:53:00 +0000 (28 13:53 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Feb 2013 21:53:00 +0000 (28 13:53 -0800)
tree1a66f722792d3c37ed2b31bdb438ed334ad13840
parent8d44277d91989ad2b37d4908096bd5256d6390c4
describe: --match=<pattern> must limit the refs even when used with --all

The logic to limit the refs used for describing with a matching pattern
with --match=<pattern> parameter was implemented incorrectly when --all
is in effect.  It just demoted a ref that did not match the pattern to
lower priority---if there aren't other refs with higher priority
that describe the given commit, such an unmatching ref was still used.

When --match is used, reject refs that do not match the given
criteria, so that with or without --all, the output will only use
refs that match the pattern.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/describe.c