1532
const char *url;
1533
const char *depth;
1534
struct list_objects_filter_options *filter_options;
1535
+ enum ref_storage_format ref_storage_format;
1536
unsigned int quiet: 1;
1537
unsigned int progress: 1;
1538
unsigned int dissociate: 1;
1541
};
1542
#define MODULE_CLONE_DATA_INIT { \
1543
.single_branch = -1, \
1544
+ .ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN, \
1545
}
1546
1547
struct submodule_alternate_setup {
1740
strvec_pushl(&cp.args, "--reference",
1741
item->string, NULL);
1742
}
1743
+ if (clone_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)
1744
+ strvec_pushf(&cp.args, "--ref-format=%s",
1745
+ ref_storage_format_to_name(clone_data->ref_storage_format));
1746
if (clone_data->dissociate)
1747
strvec_push(&cp.args, "--dissociate");
1748
if (sm_gitdir && *sm_gitdir)
1837
struct string_list reference = STRING_LIST_INIT_NODUP;
1838
struct list_objects_filter_options filter_options =
1839
LIST_OBJECTS_FILTER_INIT;
1840
+ const char *ref_storage_format = NULL;
1841
1842
struct option module_clone_options[] = {
1843
OPT_STRING(0, "prefix", &clone_data.prefix,
1855
OPT_STRING_LIST(0, "reference", &reference,
1856
N_("repo"),
1857
N_("reference repository")),
1858
+ OPT_STRING(0, "ref-format", &ref_storage_format, N_("format"),
1859
+ N_("specify the reference format to use")),
1860
OPT_BOOL(0, "dissociate", &dissociate,
1861
N_("use --reference only while cloning")),
1862
OPT_STRING(0, "depth", &clone_data.depth,
1883
argc = parse_options(argc, argv, prefix, module_clone_options,
1884
git_submodule_helper_usage, 0);
1885
1886
+ if (ref_storage_format) {
1887
+ clone_data.ref_storage_format = ref_storage_format_by_name(ref_storage_format);
1888
+ if (clone_data.ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
1889
+ die(_("unknown ref storage format '%s'"), ref_storage_format);
1890
+ }
1891
clone_data.dissociate = !!dissociate;
1892
clone_data.quiet = !!quiet;
1893
clone_data.progress = !!progress;
1987
struct submodule_update_strategy update_strategy;
1988
struct list_objects_filter_options *filter_options;
1989
struct module_list list;
1990
+ enum ref_storage_format ref_storage_format;
1991
int depth;
1992
int max_jobs;
1993
int single_branch;
2011
#define UPDATE_DATA_INIT { \
2012
.update_strategy = SUBMODULE_UPDATE_STRATEGY_INIT, \
2013
.list = MODULE_LIST_INIT, \
2014
+ .ref_storage_format = REF_STORAGE_FORMAT_UNKNOWN, \
2015
.recommend_shallow = -1, \
2016
.references = STRING_LIST_INIT_DUP, \
2017
.single_branch = -1, \
2147
expand_list_objects_filter_spec(suc->update_data->filter_options));
2148
if (suc->update_data->require_init)
2149
strvec_push(&child->args, "--require-init");
2150
+ if (suc->update_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)
2151
+ strvec_pushf(&child->args, "--ref-format=%s",
2152
+ ref_storage_format_to_name(suc->update_data->ref_storage_format));
2153
strvec_pushl(&child->args, "--path", sub->path, NULL);
2154
strvec_pushl(&child->args, "--name", sub->name, NULL);
2155
strvec_pushl(&child->args, "--url", url, NULL);
2580
for_each_string_list_item(item, &update_data->references)
2581
strvec_pushl(args, "--reference", item->string, NULL);
2582
}
2583
+ if (update_data->ref_storage_format != REF_STORAGE_FORMAT_UNKNOWN)
2584
+ strvec_pushf(args, "--ref-format=%s",
2585
+ ref_storage_format_to_name(update_data->ref_storage_format));
2586
if (update_data->filter_options && update_data->filter_options->choice)
2587
strvec_pushf(args, "--filter=%s",
2588
expand_list_objects_filter_spec(
2758
struct update_data opt = UPDATE_DATA_INIT;
2759
struct list_objects_filter_options filter_options =
2760
LIST_OBJECTS_FILTER_INIT;
2761
+ const char *ref_storage_format = NULL;
2762
int ret;
2763
struct option module_update_options[] = {
2764
OPT__SUPER_PREFIX(&opt.super_prefix),
2782
SM_UPDATE_REBASE),
2783
OPT_STRING_LIST(0, "reference", &opt.references, N_("repo"),
2784
N_("reference repository")),
2785
+ OPT_STRING(0, "ref-format", &ref_storage_format, N_("format"),
2786
+ N_("specify the reference format to use")),
2787
OPT_BOOL(0, "dissociate", &opt.dissociate,
2788
N_("use --reference only while cloning")),
2789
OPT_INTEGER(0, "depth", &opt.depth,
2827
module_update_options);
2828
}
2829
2830
+ if (ref_storage_format) {
2831
+ opt.ref_storage_format = ref_storage_format_by_name(ref_storage_format);
2832
+ if (opt.ref_storage_format == REF_STORAGE_FORMAT_UNKNOWN)
2833
+ die(_("unknown ref storage format '%s'"), ref_storage_format);
2834
+ }
2835
+
2836
opt.filter_options = &filter_options;
2837
opt.prefix = prefix;
2838