From: Junio C Hamano Date: Thu, 15 Aug 2024 20:22:14 +0000 (-0700) Subject: Merge branch 'ps/submodule-ref-format' X-Git-Tag: v2.47.0-rc0~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88457a6151ca7bd46ce1a809f9740340b712e242;p=thirdparty%2Fgit.git Merge branch 'ps/submodule-ref-format' Support to specify ref backend for submodules has been enhanced. * ps/submodule-ref-format: object: fix leaking packfiles when closing object store submodule: fix leaking seen submodule names submodule: fix leaking fetch tasks builtin/submodule: allow "add" to use different ref storage format refs: fix ref storage format for submodule ref stores builtin/clone: propagate ref storage format to submodules builtin/submodule: allow cloning with different ref storage format git-submodule.sh: break overly long command lines --- 88457a6151ca7bd46ce1a809f9740340b712e242 diff --cc builtin/submodule--helper.c index 673810d2c0,48f4577b53..ce45243308 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@@ -1530,8 -1530,9 +1530,9 @@@ struct module_clone_data const char *path; const char *name; const char *url; - const char *depth; + int depth; struct list_objects_filter_options *filter_options; + enum ref_storage_format ref_storage_format; unsigned int quiet: 1; unsigned int progress: 1; unsigned int dissociate: 1; @@@ -1849,9 -1855,12 +1855,11 @@@ static int module_clone(int argc, cons OPT_STRING_LIST(0, "reference", &reference, N_("repo"), N_("reference repository")), + OPT_STRING(0, "ref-format", &ref_storage_format, N_("format"), + N_("specify the reference format to use")), OPT_BOOL(0, "dissociate", &dissociate, N_("use --reference only while cloning")), - OPT_STRING(0, "depth", &clone_data.depth, - N_("string"), + OPT_INTEGER(0, "depth", &clone_data.depth, N_("depth for shallow clones")), OPT__QUIET(&quiet, "suppress output for cloning a submodule"), OPT_BOOL(0, "progress", &progress, @@@ -3201,9 -3232,10 +3235,10 @@@ static int add_submodule(const struct a string_list_append(&reference, p)->util = p; } + clone_data.ref_storage_format = add_data->ref_storage_format; clone_data.dissociate = add_data->dissociate; if (add_data->depth >= 0) - clone_data.depth = xstrfmt("%d", add_data->depth); + clone_data.depth = add_data->depth; if (clone_submodule(&clone_data, &reference)) goto cleanup;