diff options
author | Junio C Hamano <gitster@pobox.com> | 2025-04-24 17:25:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-04-24 17:25:34 -0700 |
commit | 2bc5414c411aab33c155b1070b7764ef6a49a02d (patch) | |
tree | 3f2b065f7c9c54838ab380ba5d16e7a9f742344b /builtin/fetch.c | |
parent | 68e5342e191a2de216dbf712a6dbfa49282429c4 (diff) | |
parent | 791aeddfa2fdb9e830e24c50c97bb5e8bf3613e6 (diff) |
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/fetch.c')
-rw-r--r-- | builtin/fetch.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 95589b4994..5279997c96 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -2352,8 +2352,14 @@ int cmd_fetch(int argc, OPT_SET_INT_F(0, "refetch", &refetch, N_("re-fetch without negotiating common commits"), 1, PARSE_OPT_NONEG), - { OPTION_STRING, 0, "submodule-prefix", &submodule_prefix, N_("dir"), - N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN }, + { + .type = OPTION_STRING, + .long_name = "submodule-prefix", + .value = &submodule_prefix, + .argh = N_("dir"), + .help = N_("prepend this to submodule path output"), + .flags = PARSE_OPT_HIDDEN, + }, OPT_CALLBACK_F(0, "recurse-submodules-default", &recurse_submodules_default, N_("on-demand"), N_("default for recursive fetching of submodules " |