X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=builtin%2Fclone.c;h=61e0989b5ab8fffb16ec28e64c38b4fa236cb3ed;hb=0b0cd0e0a29a139f418991dd769ea4266ffec370;hp=efb1e6faa539935de0e9dc590237185a1d222322;hpb=c7f649a794250ca680569bd8c2466af42acb434a;p=~andy%2Fgit diff --git a/builtin/clone.c b/builtin/clone.c index efb1e6faa..61e0989b5 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -66,6 +66,8 @@ static struct option builtin_clone_options[] = { "setup as shared repository"), OPT_BOOLEAN(0, "recursive", &option_recursive, "initialize submodules in the clone"), + OPT_BOOLEAN(0, "recurse_submodules", &option_recursive, + "initialize submodules in the clone"), OPT_STRING(0, "template", &option_template, "path", "path the template repository"), OPT_STRING(0, "reference", &option_reference, "repo", @@ -361,7 +363,7 @@ static void write_remote_refs(const struct ref *local_refs) int cmd_clone(int argc, const char **argv, const char *prefix) { - int is_bundle = 0; + int is_bundle = 0, is_local; struct stat buf; const char *repo_name, *repo, *work_tree, *git_dir; char *path, *dir; @@ -414,6 +416,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) repo = xstrdup(make_absolute_path(repo_name)); else repo = repo_name; + is_local = path && !is_bundle; + if (is_local && option_depth) + warning("--depth is ignored in local clones; use file:// instead."); if (argc == 2) dir = xstrdup(argv[1]); @@ -514,7 +519,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) strbuf_reset(&value); - if (path && !is_bundle) { + if (is_local) { refs = clone_local(path, git_dir); mapped_refs = wanted_peer_refs(refs, refspec); } else {