#define USE_THE_REPOSITORY_VARIABLE
#include "builtin.h"
#include "abspath.h"
#include "advice.h"
#include "config.h"
#include "copy.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
#include "refs.h"
#include "refspec.h"
#include "object-file.h"
#include "object-store-ll.h"
#include "tree.h"
#include "tree-walk.h"
#include "unpack-trees.h"
#include "transport.h"
#include "strbuf.h"
#include "dir.h"
#include "dir-iterator.h"
#include "iterator.h"
#include "sigchain.h"
#include "branch.h"
#include "remote.h"
#include "run-command.h"
#include "setup.h"
#include "connected.h"
#include "packfile.h"
#include "path.h"
#include "pkt-line.h"
#include "list-objects-filter-options.h"
#include "hook.h"
#include "bundle.h"
#include "bundle-uri.h"
static const char * const builtin_clone_usage[] = …;
static int option_no_checkout, option_bare, option_mirror, option_single_branch = …;
static int option_local = …, option_no_hardlinks, option_shared;
static int option_no_tags;
static int option_shallow_submodules;
static int option_reject_shallow = …;
static int config_reject_shallow = …;
static int deepen;
static char *option_template, *option_depth, *option_since;
static char *option_origin = …;
static char *remote_name = …;
static char *option_branch = …;
static struct string_list option_not = …;
static const char *real_git_dir;
static const char *ref_format;
static const char *option_upload_pack = …;
static int option_verbosity;
static int option_progress = …;
static int option_sparse_checkout;
static enum transport_family family;
static struct string_list option_config = …;
static struct string_list option_required_reference = …;
static struct string_list option_optional_reference = …;
static int option_dissociate;
static int max_jobs = …;
static struct string_list option_recurse_submodules = …;
static struct list_objects_filter_options filter_options = …;
static int option_filter_submodules = …;
static int config_filter_submodules = …;
static struct string_list server_options = …;
static int option_remote_submodules;
static const char *bundle_uri;
static int recurse_submodules_cb(const struct option *opt,
const char *arg, int unset)
{ … }
static struct option builtin_clone_options[] = …;
static const char *get_repo_path_1(struct strbuf *path, int *is_bundle)
{ … }
static char *get_repo_path(const char *repo, int *is_bundle)
{ … }
static int add_one_reference(struct string_list_item *item, void *cb_data)
{ … }
static void setup_reference(void)
{ … }
static void copy_alternates(struct strbuf *src, const char *src_repo)
{ … }
static void mkdir_if_missing(const char *pathname, mode_t mode)
{ … }
static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest,
const char *src_repo)
{ … }
static void clone_local(const char *src_repo, const char *dest_repo)
{ … }
static const char *junk_work_tree;
static int junk_work_tree_flags;
static const char *junk_git_dir;
static int junk_git_dir_flags;
static enum { … } junk_mode = …;
static const char junk_leave_repo_msg[] = …);
static void remove_junk(void)
{ … }
static void remove_junk_on_signal(int signo)
{ … }
static struct ref *find_remote_branch(const struct ref *refs, const char *branch)
{ … }
static struct ref *wanted_peer_refs(const struct ref *refs,
struct refspec *refspec)
{ … }
static void write_remote_refs(const struct ref *local_refs)
{ … }
static void write_followtags(const struct ref *refs, const char *msg)
{ … }
static const struct object_id *iterate_ref_map(void *cb_data)
{ … }
static void update_remote_refs(const struct ref *refs,
const struct ref *mapped_refs,
const struct ref *remote_head_points_at,
const char *branch_top,
const char *msg,
struct transport *transport,
int check_connectivity)
{ … }
static void update_head(const struct ref *our, const struct ref *remote,
const char *unborn, const char *msg)
{ … }
static int git_sparse_checkout_init(const char *repo)
{ … }
static int checkout(int submodule_progress, int filter_submodules,
enum ref_storage_format ref_storage_format)
{ … }
static int git_clone_config(const char *k, const char *v,
const struct config_context *ctx, void *cb)
{ … }
static int write_one_config(const char *key, const char *value,
const struct config_context *ctx,
void *data)
{ … }
static void write_config(struct string_list *config)
{ … }
static void write_refspec_config(const char *src_ref_prefix,
const struct ref *our_head_points_at,
const struct ref *remote_head_points_at,
struct strbuf *branch_top)
{ … }
static void dissociate_from_references(void)
{ … }
static int path_exists(const char *path)
{ … }
int cmd_clone(int argc,
const char **argv,
const char *prefix,
struct repository *repository UNUSED)
{ … }