The command itself takes an optional <pattern> argument that limits the shown tags to the ones that match when in listing mode that is triggered with '-l' option. The <pattern> is not an optional option-argument to '-l'.
With this fix, "git tag -l -n 4 v0.99" works as expected.
It also removes a few bogus tests in t7004.
Signed-off-by: Pierre Habouzit <firstname.lastname@example.org> Signed-off-by: Junio C Hamano <email@example.com>