ref-filter: make "%(symref)" atom work with the ':short' modifier

The "%(symref)" atom doesn't work when used with the ':short' modifier
because we strictly match only 'symref' for setting the 'need_symref'
indicator. Fix this by comparing with the valid_atom rather than the
used_atom.

Add tests for %(symref) and %(symref:short) while we're here.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Karthik Nayak <Karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Karthik Nayak
2017-01-10 14:19:42 +05:30
committed by Junio C Hamano
parent 7743fcca5b
commit 01f95825d5
2 changed files with 25 additions and 1 deletions

View File

@ -352,7 +352,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
valid_atom[i].parser(&used_atom[at], arg);
if (*atom == '*')
need_tagged = 1;
if (!strcmp(used_atom[at].name, "symref"))
if (!strcmp(valid_atom[i].name, "symref"))
need_symref = 1;
return at;
}