Use OPT_BIT in builtin-pack-refs
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pierre Habouzit committed
Nov 7, 2007 at 11:20 UTC
68dce6e941af73be34bccfe2be335b7887955ee5
1 file changed
+3
-9
builtin-pack-refs.c
+3
-9
@@ -122,19 +122,13 @@ static char const * const pack_refs_usage[] = {
122
123
int cmd_pack_refs(int argc, const char **argv, const char *prefix)
124
{
125
- int all = 0, prune = 1;
126
- unsigned int flags = 0;
125
+ unsigned int flags = PACK_REFS_PRUNE;
126
struct option opts[] = {
128
- OPT_BOOLEAN(0, "all", &all, "pack everything"),
129
- OPT_BOOLEAN(0, "prune", &prune, "prune loose refs (default)"),
127
+ OPT_BIT(0, "all", &flags, "pack everything", PACK_REFS_ALL),
128
+ OPT_BIT(0, "prune", &flags, "prune loose refs (default)", PACK_REFS_PRUNE),
129
OPT_END(),
130
};
132
-
131
if (parse_options(argc, argv, opts, pack_refs_usage, 0))
132
usage_with_options(pack_refs_usage, opts);
135
- if (prune)
136
- flags |= PACK_REFS_PRUNE;
137
- if (all)
138
- flags |= PACK_REFS_ALL;
133
return pack_refs(flags);
134
}