MCPcopy Index your code
hub / github.com/git/git / cmd_fetch

Function cmd_fetch

builtin/fetch.c:2467–2892  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2465}
2466
2467int cmd_fetch(int argc,
2468 const char **argv,
2469 const char *prefix,
2470 struct repository *repo UNUSED)
2471{
2472 struct fetch_config config = {
2473 .display_format = DISPLAY_FORMAT_FULL,
2474 .prune = -1,
2475 .prune_tags = -1,
2476 .show_forced_updates = 1,
2477 .recurse_submodules = RECURSE_SUBMODULES_DEFAULT,
2478 .parallel = 1,
2479 .submodule_fetch_jobs = -1,
2480 };
2481 const char *submodule_prefix = "";
2482 const char *bundle_uri;
2483 struct string_list list = STRING_LIST_INIT_DUP;
2484 struct list_objects_filter_options filter_options = LIST_OBJECTS_FILTER_INIT;
2485 struct remote *remote = NULL;
2486 int all = -1, multiple = 0;
2487 int result = 0;
2488 int prune_tags_ok = 1;
2489 int enable_auto_gc = 1;
2490 int unshallow = 0;
2491 int max_jobs = -1;
2492 int recurse_submodules_cli = RECURSE_SUBMODULES_DEFAULT;
2493 int recurse_submodules_default = RECURSE_SUBMODULES_ON_DEMAND;
2494 int fetch_write_commit_graph = -1;
2495 int stdin_refspecs = 0;
2496 int negotiate_only = 0;
2497 int porcelain = 0;
2498 int i;
2499
2500 struct option builtin_fetch_options[] = {
2501 OPT__VERBOSITY(&verbosity),
2502 OPT_BOOL(0, "all", &all,
2503 N_("fetch from all remotes")),
2504 OPT_BOOL(0, "set-upstream", &set_upstream,
2505 N_("set upstream for git pull/fetch")),
2506 OPT_BOOL('a', "append", &append,
2507 N_("append to .git/FETCH_HEAD instead of overwriting")),
2508 OPT_BOOL(0, "atomic", &atomic_fetch,
2509 N_("use atomic transaction to update references")),
2510 OPT_STRING(0, "upload-pack", &upload_pack, N_("path"),
2511 N_("path to upload pack on remote end")),
2512 OPT__FORCE(&force, N_("force overwrite of local reference"), 0),
2513 OPT_BOOL('m', "multiple", &multiple,
2514 N_("fetch from multiple remotes")),
2515 OPT_SET_INT('t', "tags", &tags,
2516 N_("fetch all tags and associated objects"), TAGS_SET),
2517 OPT_SET_INT('n', NULL, &tags,
2518 N_("do not fetch all tags (--no-tags)"), TAGS_UNSET),
2519 OPT_INTEGER('j', "jobs", &max_jobs,
2520 N_("number of submodules fetched in parallel")),
2521 OPT_BOOL(0, "prefetch", &prefetch,
2522 N_("modify the refspec to place all refs within refs/prefetch/")),
2523 OPT_BOOL('p', "prune", &prune,
2524 N_("prune remote-tracking branches no longer on remote")),

Callers

nothing calls this directly

Calls 15

packet_trace_identityFunction · 0.85
strbuf_addstrFunction · 0.85
transport_anonymize_urlFunction · 0.85
strbuf_addfFunction · 0.85
prepare_repo_settingsFunction · 0.85
parse_optionsFunction · 0.85
xstrfmtFunction · 0.85
is_repository_shallowFunction · 0.85
online_cpusFunction · 0.85
fetch_bundle_uriFunction · 0.85

Tested by

no test coverage detected