summaryrefslogtreecommitdiff
path: root/builtin/init-db.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/init-db.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/init-db.c')
-rw-r--r--builtin/init-db.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 91c2563e34..bb853e69f5 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -92,10 +92,15 @@ int cmd_init_db(int argc,
N_("directory from which templates will be used")),
OPT_SET_INT(0, "bare", &is_bare_repository_cfg,
N_("create a bare repository"), 1),
- { OPTION_CALLBACK, 0, "shared", &init_shared_repository,
- N_("permissions"),
- N_("specify that the git repository is to be shared amongst several users"),
- PARSE_OPT_OPTARG | PARSE_OPT_NONEG, shared_callback, 0},
+ {
+ .type = OPTION_CALLBACK,
+ .long_name = "shared",
+ .value = &init_shared_repository,
+ .argh = N_("permissions"),
+ .help = N_("specify that the git repository is to be shared amongst several users"),
+ .flags = PARSE_OPT_OPTARG | PARSE_OPT_NONEG,
+ .callback = shared_callback
+ },
OPT_BIT('q', "quiet", &flags, N_("be quiet"), INIT_DB_QUIET),
OPT_STRING(0, "separate-git-dir", &real_git_dir, N_("gitdir"),
N_("separate git dir from working tree")),