@matheusbsbs / matheus-bagliano / commits / e7951290f6
Fork 0

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 <azol@altlinux.org> Reported-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Tested-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Mar 13, 2008 at 08:13 UTC e7951290f6f87ac413a3f1e3a870619275453efe
1 file changed +2
builtin-fetch.c
+2
@@ -40,6 +40,8 @@ static struct option builtin_fetch_options[] = {
40 "force overwrite of local branch"),
41 OPT_SET_INT('t', "tags", &tags,
42 "fetch all tags and associated objects", TAGS_SET),
43 + OPT_SET_INT('n', NULL, &tags,
44 + "do not fetch all tags (--no-tags)", TAGS_UNSET),
45 OPT_BOOLEAN('k', "keep", &keep, "keep downloaded pack"),
46 OPT_BOOLEAN('u', "update-head-ok", &update_head_ok,
47 "allow updating of HEAD ref"),