]>
Commit | Line | Data |
---|---|---|
c2e86add | 1 | #include "builtin.h" |
8e712ef6 | 2 | #include "config.h" |
b2565ae5 | 3 | #include "parse-options.h" |
32d462ce | 4 | #include "refs.h" |
23a3f0cb | 5 | #include "repository.h" |
96884601 | 6 | |
b2565ae5 | 7 | static char const * const pack_refs_usage[] = { |
9c9b4f2f | 8 | N_("git pack-refs [<options>]"), |
b2565ae5 PH |
9 | NULL |
10 | }; | |
11 | ||
99b5a79e LT |
12 | int cmd_pack_refs(int argc, const char **argv, const char *prefix) |
13 | { | |
68dce6e9 | 14 | unsigned int flags = PACK_REFS_PRUNE; |
b2565ae5 | 15 | struct option opts[] = { |
e08b7353 NTND |
16 | OPT_BIT(0, "all", &flags, N_("pack everything"), PACK_REFS_ALL), |
17 | OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE), | |
b2565ae5 PH |
18 | OPT_END(), |
19 | }; | |
8e712ef6 | 20 | git_config(git_default_config, NULL); |
37782920 | 21 | if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0)) |
b2565ae5 | 22 | usage_with_options(pack_refs_usage, opts); |
23a3f0cb | 23 | return refs_pack_refs(get_main_ref_store(the_repository), flags); |
e1e22e37 | 24 | } |