From: Johannes Schindelin Date: Thu, 13 Mar 2008 07:13:15 +0000 (+0100) Subject: git fetch: Take '-n' to mean '--no-tags' X-Git-Tag: v1.5.5-rc0~2^2~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e7951290f6f87ac413a3f1e3a870619275453efe;p=git.git git fetch: Take '-n' to mean '--no-tags' Prior to commit 8320199 (Rewrite builtin-fetch option parsing to use parse_options().), we understood '-n' as a short option to mean "don't fetch tags from the remote". This patch reinstates behaviour similar, but not identical to the pre commit 8320199 times. Back then, -n always overrode --tags, so if both --tags and -n was given on command-line, no tags were fetched regardless of argument ordering. Now we use a "last entry wins" strategy, so '-n --tags' means "fetch tags". Since it's patently absurd to say both --tags and --no-tags, this shouldn't matter in practice. Spotted-by: Artem Zolochevskiy Reported-by: Dmitry V. Levin Signed-off-by: Johannes Schindelin Tested-by: Andreas Ericsson Signed-off-by: Junio C Hamano --- diff --git a/builtin-fetch.c b/builtin-fetch.c index 320e23568..9a6ddcec9 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -40,6 +40,8 @@ static struct option builtin_fetch_options[] = { "force overwrite of local branch"), OPT_SET_INT('t', "tags", &tags, "fetch all tags and associated objects", TAGS_SET), + OPT_SET_INT('n', NULL, &tags, + "do not fetch all tags (--no-tags)", TAGS_UNSET), OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"), OPT_BOOLEAN('u', "update-head-ok", &update_head_ok, "allow updating of HEAD ref"),