summaryrefslogtreecommitdiff
path: root/builtin/write-tree.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/write-tree.c
parent68e5342e191a2de216dbf712a6dbfa49282429c4 (diff)
parent791aeddfa2fdb9e830e24c50c97bb5e8bf3613e6 (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/write-tree.c')
-rw-r--r--builtin/write-tree.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 43f233e69b..5a8dc377ec 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -31,10 +31,14 @@ int cmd_write_tree(int argc,
WRITE_TREE_MISSING_OK),
OPT_STRING(0, "prefix", &tree_prefix, N_("<prefix>/"),
N_("write tree object for a subdirectory <prefix>")),
- { OPTION_BIT, 0, "ignore-cache-tree", &flags, NULL,
- N_("only useful for debugging"),
- PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, NULL,
- WRITE_TREE_IGNORE_CACHE_TREE },
+ {
+ .type = OPTION_BIT,
+ .long_name = "ignore-cache-tree",
+ .value = &flags,
+ .help = N_("only useful for debugging"),
+ .flags = PARSE_OPT_HIDDEN | PARSE_OPT_NOARG,
+ .defval = WRITE_TREE_IGNORE_CACHE_TREE,
+ },
OPT_END()
};