From: Pierre Habouzit Date: Mon, 17 Dec 2007 18:23:17 GMT Subject: [PATCH 7/7] git-tag: fix -l switch handling regression. Message-ID: <1197915797-30679-8-git-send-email-madcoder@debian.org> In-Reply-To: <1197915797-30679-7-git-send-email-madcoder@debian.org> Signed-off-by: Pierre Habouzit --- builtin-tag.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/builtin-tag.c b/builtin-tag.c index fd44b2e..c7a1563 100644 --- a/builtin-tag.c +++ b/builtin-tag.c @@ -16,7 +16,7 @@ static const char * const git_tag_usage[] = { "git-tag [-a|-s|-u ] [-f] [-m |-F ] []", "git-tag -d ...", - "git-tag [-n []] -l []", + "git-tag -l [-n []] []", "git-tag -v ...", NULL }; @@ -370,13 +370,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix) struct ref_lock *lock; int annotate = 0, sign = 0, force = 0, lines = 0, - delete = 0, verify = 0; - char *list = NULL, *msgfile = NULL, *keyid = NULL; - const char *no_pattern = "NO_PATTERN"; + list = 0, delete = 0, verify = 0; + char *msgfile = NULL, *keyid = NULL; struct msg_arg msg = { 0, STRBUF_INIT }; struct option options[] = { - { OPTION_STRING, 'l', NULL, &list, "pattern", "list tag names", - PARSE_OPT_OPTARG, NULL, (intptr_t) no_pattern }, + OPT_INTEGER('l', NULL, &list, "list tag names"), { OPTION_INTEGER, 'n', NULL, &lines, NULL, "print n lines of each tag message", PARSE_OPT_OPTARG, NULL, 1 }, @@ -408,7 +406,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) annotate = 1; if (list) - return list_tags(list == no_pattern ? NULL : list, lines); + return list_tags(argv[0], lines); if (delete) return for_each_tag_name(argv, delete_tag); if (verify) -- 1.5.4.rc0.1148.ga3ab1-dirty