]> git.ipfire.org Git - thirdparty/git.git/blob - builtin/pack-refs.c
treewide: be explicit about dependence on gettext.h
[thirdparty/git.git] / builtin / pack-refs.c
1 #include "builtin.h"
2 #include "config.h"
3 #include "gettext.h"
4 #include "parse-options.h"
5 #include "refs.h"
6 #include "repository.h"
7
8 static char const * const pack_refs_usage[] = {
9 N_("git pack-refs [--all] [--no-prune]"),
10 NULL
11 };
12
13 int cmd_pack_refs(int argc, const char **argv, const char *prefix)
14 {
15 unsigned int flags = PACK_REFS_PRUNE;
16 struct option opts[] = {
17 OPT_BIT(0, "all", &flags, N_("pack everything"), PACK_REFS_ALL),
18 OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
19 OPT_END(),
20 };
21 git_config(git_default_config, NULL);
22 if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
23 usage_with_options(pack_refs_usage, opts);
24 return refs_pack_refs(get_main_ref_store(the_repository), flags);
25 }