2588
return 0;
2589
}
2590
2591
-static int option_parse_ulong(const struct option *opt,
2592
- const char *arg, int unset)
2593
-{
2594
- if (unset)
2595
- die(_("option %s does not accept negative form"),
2596
- opt->long_name);
2597
-
2598
- if (!git_parse_ulong(arg, opt->value))
2599
- die(_("unable to parse value '%s' for option %s"),
2600
- arg, opt->long_name);
2601
- return 0;
2602
-}
2603
-
2604
-#define OPT_ULONG(s, l, v, h) \
2605
- { OPTION_CALLBACK, (s), (l), (v), "n", (h), \
2606
- PARSE_OPT_NONEG, option_parse_ulong }
2607
-
2591
int cmd_pack_objects(int argc, const char **argv, const char *prefix)
2592
{
2593
int use_internal_rev_list = 0;
2610
{ OPTION_CALLBACK, 0, "index-version", NULL, N_("version[,offset]"),
2611
N_("write the pack index file in the specified idx format version"),
2612
0, option_parse_index_version },
2630
- OPT_ULONG(0, "max-pack-size", &pack_size_limit,
2631
- N_("maximum size of each output pack file")),
2613
+ OPT_MAGNITUDE(0, "max-pack-size", &pack_size_limit,
2614
+ N_("maximum size of each output pack file")),
2615
OPT_BOOL(0, "local", &local,
2616
N_("ignore borrowed objects from alternate object store")),
2617
OPT_BOOL(0, "incremental", &incremental,
2618
N_("ignore packed objects")),
2619
OPT_INTEGER(0, "window", &window,
2620
N_("limit pack window by objects")),
2638
- OPT_ULONG(0, "window-memory", &window_memory_limit,
2639
- N_("limit pack window by memory in addition to object limit")),
2621
+ OPT_MAGNITUDE(0, "window-memory", &window_memory_limit,
2622
+ N_("limit pack window by memory in addition to object limit")),
2623
OPT_INTEGER(0, "depth", &depth,
2624
N_("maximum length of delta chain allowed in the resulting pack")),
2625
OPT_BOOL(0, "reuse-delta", &reuse_delta,