From: Junio C Hamano Date: Thu, 3 Sep 2009 02:52:18 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.6.5-rc0~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/193a5d195ba6b88e0d69f2b81dc4ec878bff8981?ds=inline;hp=-c Merge branch 'maint' * maint: git-cvsserver: no longer use deprecated 'git-subcommand' commands clone: disconnect transport after fetching --- 193a5d195ba6b88e0d69f2b81dc4ec878bff8981 diff --combined builtin-clone.c index 991a7ae92f,e51978a157..0f231d8af5 --- a/builtin-clone.c +++ b/builtin-clone.c @@@ -38,7 -38,7 +38,7 @@@ static const char * const builtin_clone }; static int option_quiet, option_no_checkout, option_bare, option_mirror; -static int option_local, option_no_hardlinks, option_shared; +static int option_local, option_no_hardlinks, option_shared, option_recursive; static char *option_template, *option_reference, *option_depth; static char *option_origin = NULL; static char *option_upload_pack = "git-upload-pack"; @@@ -59,8 -59,6 +59,8 @@@ static struct option builtin_clone_opti "don't use local hardlinks, always copy"), OPT_BOOLEAN('s', "shared", &option_shared, "setup as shared repository"), + OPT_BOOLEAN(0, "recursive", &option_recursive, + "setup as shared repository"), OPT_STRING(0, "template", &option_template, "path", "path the template repository"), OPT_STRING(0, "reference", &option_reference, "repo", @@@ -75,10 -73,6 +75,10 @@@ OPT_END() }; +static const char *argv_submodule[] = { + "submodule", "update", "--init", "--recursive", NULL +}; + static char *get_repo_path(const char *repo, int *is_bundle) { static char *suffix[] = { "/.git", ".git", "" }; @@@ -515,7 -509,7 +515,7 @@@ int cmd_clone(int argc, const char **ar option_upload_pack); refs = transport_get_remote_refs(transport); - if(refs) + if (refs) transport_fetch_refs(transport, refs); } @@@ -580,8 -574,10 +580,10 @@@ option_no_checkout = 1; } - if (transport) + if (transport) { transport_unlock_pack(transport); + transport_disconnect(transport); + } if (!option_no_checkout) { struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file)); @@@ -614,9 -610,6 +616,9 @@@ err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1), sha1_to_hex(remote_head->old_sha1), "1", NULL); + + if (!err && option_recursive) + err = run_command_v_opt(argv_submodule, RUN_GIT_CMD); } strbuf_release(&reflog_msg);