blob: b5a0f88eb8c5641b41bfe95bd342fb180e7fadad [file] [log] [blame]
Stephen Boydc2e86ad2011-03-22 00:51:05 -07001#include "builtin.h"
Pierre Habouzitb2565ae2007-10-15 23:06:02 +02002#include "parse-options.h"
Johan Herland94e724a2008-06-15 16:05:06 +02003#include "pack-refs.h"
Linus Torvalds99b5a792007-05-26 09:25:31 -07004
Pierre Habouzitb2565ae2007-10-15 23:06:02 +02005static char const * const pack_refs_usage[] = {
Nguyễn Thái Ngọc Duye08b7352012-08-20 19:32:30 +07006 N_("git pack-refs [options]"),
Pierre Habouzitb2565ae2007-10-15 23:06:02 +02007 NULL
8};
9
Linus Torvalds99b5a792007-05-26 09:25:31 -070010int cmd_pack_refs(int argc, const char **argv, const char *prefix)
11{
Pierre Habouzit68dce6e2007-11-07 11:20:30 +010012 unsigned int flags = PACK_REFS_PRUNE;
Pierre Habouzitb2565ae2007-10-15 23:06:02 +020013 struct option opts[] = {
Nguyễn Thái Ngọc Duye08b7352012-08-20 19:32:30 +070014 OPT_BIT(0, "all", &flags, N_("pack everything"), PACK_REFS_ALL),
15 OPT_BIT(0, "prune", &flags, N_("prune loose refs (default)"), PACK_REFS_PRUNE),
Pierre Habouzitb2565ae2007-10-15 23:06:02 +020016 OPT_END(),
17 };
Stephen Boyd37782922009-05-23 11:53:12 -070018 if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
Pierre Habouzitb2565ae2007-10-15 23:06:02 +020019 usage_with_options(pack_refs_usage, opts);
Linus Torvalds99b5a792007-05-26 09:25:31 -070020 return pack_refs(flags);
21}