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

Function cmd_clone

builtin/clone.c:869–1656  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867}
868
869int cmd_clone(int argc,
870 const char **argv,
871 const char *prefix,
872 struct repository *repository UNUSED)
873{
874 int is_bundle = 0, is_local;
875 int reject_shallow = 0;
876 const char *repo_name, *repo, *work_tree, *git_dir;
877 char *repo_to_free = NULL;
878 char *path = NULL, *dir, *display_repo = NULL;
879 int dest_exists, real_dest_exists = 0;
880 const struct ref *refs, *remote_head;
881 struct ref *remote_head_points_at = NULL;
882 const struct ref *our_head_points_at;
883 char *unborn_head = NULL;
884 struct ref *mapped_refs = NULL;
885 const struct ref *ref;
886 struct strbuf key = STRBUF_INIT;
887 struct strbuf buf = STRBUF_INIT;
888 struct strbuf branch_top = STRBUF_INIT, reflog_msg = STRBUF_INIT;
889 struct transport *transport = NULL;
890 const char *src_ref_prefix = "refs/heads/";
891 struct remote *remote;
892 int err = 0, complete_refs_before_fetch = 1;
893 int submodule_progress;
894 int filter_submodules = 0;
895 int hash_algo;
896 enum ref_storage_format ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN;
897 const int do_not_override_repo_unix_permissions = -1;
898 int option_reject_shallow = -1; /* unspecified */
899 int deepen = 0;
900 char *option_template = NULL, *option_depth = NULL, *option_since = NULL;
901 char *option_origin = NULL;
902 struct string_list option_not = STRING_LIST_INIT_NODUP;
903 const char *real_git_dir = NULL;
904 const char *ref_format = NULL;
905 const char *option_upload_pack = "git-upload-pack";
906 int option_progress = -1;
907 int option_sparse_checkout = 0;
908 enum transport_family family = TRANSPORT_FAMILY_ALL;
909 struct string_list option_config = STRING_LIST_INIT_DUP;
910 int option_dissociate = 0;
911 struct list_objects_filter_options filter_options = LIST_OBJECTS_FILTER_INIT;
912 int option_filter_submodules = -1; /* unspecified */
913 struct string_list server_options = STRING_LIST_INIT_NODUP;
914 const char *bundle_uri = NULL;
915 char *option_rev = NULL;
916
917 struct clone_opts opts = CLONE_OPTS_INIT;
918
919 struct transport_ls_refs_options transport_ls_refs_options =
920 TRANSPORT_LS_REFS_OPTIONS_INIT;
921
922 struct option builtin_clone_options[] = {
923 OPT__VERBOSITY(&option_verbosity),
924 OPT_BOOL(0, "progress", &option_progress,
925 N_("force progress reporting")),
926 OPT_BOOL(0, "reject-shallow", &option_reject_shallow,

Callers

nothing calls this directly

Calls 15

packet_trace_identityFunction · 0.85
parse_optionsFunction · 0.85
usage_msg_optFunction · 0.85
get_repo_pathFunction · 0.85
absolute_pathdupFunction · 0.85
transport_anonymize_urlFunction · 0.85
xstrdupFunction · 0.85
git_url_basenameFunction · 0.85
is_empty_dirFunction · 0.85
strbuf_addfFunction · 0.85

Tested by

no test coverage detected