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/commit-tree.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/commit-tree.c')
-rw-r--r-- | builtin/commit-tree.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c index 6f9975e7a8..ad6b2c9320 100644 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@ -111,8 +111,16 @@ int cmd_commit_tree(int argc, OPT_CALLBACK_F('F', NULL, &buffer, N_("file"), N_("read commit log message from file"), PARSE_OPT_NONEG, parse_file_arg_callback), - { OPTION_STRING, 'S', "gpg-sign", &sign_commit, N_("key-id"), - N_("GPG sign commit"), PARSE_OPT_OPTARG, NULL, (intptr_t) "" }, + { + .type = OPTION_STRING, + .short_name = 'S', + .long_name = "gpg-sign", + .value = &sign_commit, + .argh = N_("key-id"), + .help = N_("GPG sign commit"), + .flags = PARSE_OPT_OPTARG, + .defval = (intptr_t) "", + }, OPT_END() }; int ret; |