|
59 | 59 |
|
60 | 60 | static int option_no_checkout, option_bare, option_mirror, option_single_branch = -1; |
61 | 61 | static int option_local = -1, option_no_hardlinks, option_shared; |
62 | | -static int option_no_tags; |
| 62 | +static int option_tags = 1; /* default enabled */ |
63 | 63 | static int option_shallow_submodules; |
64 | 64 | static int config_reject_shallow = -1; /* unspecified */ |
65 | 65 | static char *remote_name = NULL; |
@@ -470,7 +470,7 @@ static struct ref *wanted_peer_refs(const struct ref *refs, |
470 | 470 | get_fetch_map(refs, &refspec->items[i], &tail, 0); |
471 | 471 | } |
472 | 472 |
|
473 | | - if (!option_mirror && !option_single_branch && !option_no_tags) |
| 473 | + if (!option_mirror && !option_single_branch && option_tags) |
474 | 474 | get_fetch_map(refs, &tag_refspec, &tail, 0); |
475 | 475 |
|
476 | 476 | refspec_item_clear(&tag_refspec); |
@@ -562,7 +562,7 @@ static void update_remote_refs(const struct ref *refs, |
562 | 562 |
|
563 | 563 | if (refs) { |
564 | 564 | write_remote_refs(mapped_refs); |
565 | | - if (option_single_branch && !option_no_tags) |
| 565 | + if (option_single_branch && option_tags) |
566 | 566 | write_followtags(refs, msg); |
567 | 567 | } |
568 | 568 |
|
@@ -964,8 +964,8 @@ int cmd_clone(int argc, |
964 | 964 | N_("deepen history of shallow clone, excluding ref")), |
965 | 965 | OPT_BOOL(0, "single-branch", &option_single_branch, |
966 | 966 | N_("clone only one branch, HEAD or --branch")), |
967 | | - OPT_BOOL(0, "no-tags", &option_no_tags, |
968 | | - N_("don't clone any tags, and make later fetches not to follow them")), |
| 967 | + OPT_BOOL(0, "tags", &option_tags, |
| 968 | + N_("clone tags, and make later fetches not to follow them")), |
969 | 969 | OPT_BOOL(0, "shallow-submodules", &option_shallow_submodules, |
970 | 970 | N_("any cloned submodules will be shallow")), |
971 | 971 | OPT_STRING(0, "separate-git-dir", &real_git_dir, N_("gitdir"), |
@@ -1296,7 +1296,7 @@ int cmd_clone(int argc, |
1296 | 1296 | git_config_set(key.buf, repo); |
1297 | 1297 | strbuf_reset(&key); |
1298 | 1298 |
|
1299 | | - if (option_no_tags) { |
| 1299 | + if (!option_tags) { |
1300 | 1300 | strbuf_addf(&key, "remote.%s.tagOpt", remote_name); |
1301 | 1301 | git_config_set(key.buf, "--no-tags"); |
1302 | 1302 | strbuf_reset(&key); |
@@ -1389,7 +1389,7 @@ int cmd_clone(int argc, |
1389 | 1389 | if (option_branch) |
1390 | 1390 | expand_ref_prefix(&transport_ls_refs_options.ref_prefixes, |
1391 | 1391 | option_branch); |
1392 | | - if (!option_no_tags) |
| 1392 | + if (option_tags) |
1393 | 1393 | strvec_push(&transport_ls_refs_options.ref_prefixes, |
1394 | 1394 | "refs/tags/"); |
1395 | 1395 |
|
|
0 commit comments