aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-24 17:25:33 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-24 17:25:34 -0700
commit2bc5414c411aab33c155b1070b7764ef6a49a02d (patch)
tree3f2b065f7c9c54838ab380ba5d16e7a9f742344b /builtin/clone.c
parentMerge branch 'ds/doc-disable-hooks' (diff)
parentparse-options: detect mismatches in integer signedness (diff)
downloadgit-2bc5414c411aab33c155b1070b7764ef6a49a02d.tar.gz
git-2bc5414c411aab33c155b1070b7764ef6a49a02d.zip
Merge branch 'ps/parse-options-integers'
Update parse-options API to catch mistakes to pass address of an integral variable of a wrong type/size. * ps/parse-options-integers: parse-options: detect mismatches in integer signedness parse-options: introduce precision handling for `OPTION_UNSIGNED` parse-options: introduce precision handling for `OPTION_INTEGER` parse-options: rename `OPT_MAGNITUDE()` to `OPT_UNSIGNED()` parse-options: support unit factors in `OPT_INTEGER()` global: use designated initializers for options parse: fix off-by-one for minimum signed values
Diffstat (limited to 'builtin/clone.c')
-rw-r--r--builtin/clone.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 6b1d11a3ed..b6f378c438 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -932,9 +932,16 @@ int cmd_clone(int argc,
N_("don't use local hardlinks, always copy")),
OPT_BOOL('s', "shared", &option_shared,
N_("setup as shared repository")),
- { OPTION_CALLBACK, 0, "recurse-submodules", &option_recurse_submodules,
- N_("pathspec"), N_("initialize submodules in the clone"),
- PARSE_OPT_OPTARG, recurse_submodules_cb, (intptr_t)"." },
+ {
+ .type = OPTION_CALLBACK,
+ .long_name = "recurse-submodules",
+ .value = &option_recurse_submodules,
+ .argh = N_("pathspec"),
+ .help = N_("initialize submodules in the clone"),
+ .flags = PARSE_OPT_OPTARG,
+ .callback = recurse_submodules_cb,
+ .defval = (intptr_t)".",
+ },
OPT_ALIAS(0, "recursive", "recurse-submodules"),
OPT_INTEGER('j', "jobs", &max_jobs,
N_("number of submodules cloned in parallel")),