clone_submodule: avoid using `access()` on directories
[git/gitster.git] / builtin / pack-refs.c
blob27c2ca06acb7d68571e6e4547a7670f62eef2619
1 #include "builtin.h"
2 #include "config.h"
3 #include "parse-options.h"
4 #include "refs.h"
5 #include "repository.h"
7 static char const * const pack_refs_usage[] = {
8 N_("git pack-refs [--all] [--no-prune]"),
9 NULL
12 int cmd_pack_refs(int argc, const char **argv, const char *prefix)
14 unsigned int flags = PACK_REFS_PRUNE;
15 struct option opts[] = {
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),
18 OPT_END(),
20 git_config(git_default_config, NULL);
21 if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
22 usage_with_options(pack_refs_usage, opts);
23 return refs_pack_refs(get_main_ref_store(the_repository), flags);