parse-options: add precision handling for OPTION_NEGBIT
Similar to 09705696f7 (parse-options: introduce precision handling for
`OPTION_INTEGER`, 2025-04-17) support value variables of different sizes
for OPTION_NEGBIT. Do that by requiring their "precision" to be set,
casting their "value" pointer accordingly and checking whether the value
fits.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
5228211c4b
commit
feeebbf1b7
@@ -1128,6 +1128,7 @@ int cmd_rebase(int argc,
|
||||
.short_name = 'n',
|
||||
.long_name = "no-stat",
|
||||
.value = &options.flags,
|
||||
.precision = sizeof(options.flags),
|
||||
.help = N_("do not show diffstat of what changed upstream"),
|
||||
.flags = PARSE_OPT_NOARG,
|
||||
.defval = REBASE_DIFFSTAT,
|
||||
|
||||
Reference in New Issue
Block a user