make "git pack-redundant" a built-in
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Linus Torvalds committed
Jan 22, 2010 at 07:42 UTC
377d0276ca7446ce9fb2f6987b1e6b4ba9e7cf29
4 files changed
+5
-7
Makefile
+1
-1
@@ -389,7 +389,6 @@ PROGRAMS += $(EXTRA_PROGRAMS)
389
PROGRAMS += git-fast-import$X
390
PROGRAMS += git-imap-send$X
391
PROGRAMS += git-index-pack$X
392
-PROGRAMS += git-pack-redundant$X
392
PROGRAMS += git-shell$X
393
PROGRAMS += git-show-index$X
394
PROGRAMS += git-upload-pack$X
@@ -673,6 +672,7 @@ BUILTIN_OBJS += builtin-mktree.o
672
BUILTIN_OBJS += builtin-mv.o
673
BUILTIN_OBJS += builtin-name-rev.o
674
BUILTIN_OBJS += builtin-pack-objects.o
675
+BUILTIN_OBJS += builtin-pack-redundant.o
676
BUILTIN_OBJS += builtin-pack-refs.o
677
BUILTIN_OBJS += builtin-patch-id.o
678
BUILTIN_OBJS += builtin-prune-packed.o
builtin-pack-redundant.c
renamed
+2
-6
@@ -568,7 +568,7 @@ static struct pack_list * add_pack(struct packed_git *p)
568
return pack_list_insert(&altodb_packs, &l);
569
}
570
571
-static struct pack_list * add_pack_file(char *filename)
571
+static struct pack_list * add_pack_file(const char *filename)
572
{
573
struct packed_git *p = packed_git;
574
@@ -593,7 +593,7 @@ static void load_all(void)
593
}
594
}
595
596
-int main(int argc, char **argv)
596
+int cmd_pack_redundant(int argc, const char **argv, const char *prefix)
597
{
598
int i;
599
struct pack_list *min, *red, *pl;
@@ -601,13 +601,9 @@ int main(int argc, char **argv)
601
unsigned char *sha1;
602
char buf[42]; /* 40 byte sha1 + \n + \0 */
603
604
- git_extract_argv0_path(argv[0]);
605
-
604
if (argc == 2 && !strcmp(argv[1], "-h"))
605
usage(pack_redundant_usage);
606
609
- setup_git_directory();
610
-
607
for (i = 1; i < argc; i++) {
608
const char *arg = argv[i];
609
if (!strcmp(arg, "--")) {
builtin.h
+1
@@ -78,6 +78,7 @@ extern int cmd_mktree(int argc, const char **argv, const char *prefix);
78
extern int cmd_mv(int argc, const char **argv, const char *prefix);
79
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
80
extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
81
+extern int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
82
extern int cmd_patch_id(int argc, const char **argv, const char *prefix);
83
extern int cmd_pickaxe(int argc, const char **argv, const char *prefix);
84
extern int cmd_prune(int argc, const char **argv, const char *prefix);
git.c
+1
@@ -343,6 +343,7 @@ static void handle_internal_command(int argc, const char **argv)
343
{ "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },
344
{ "name-rev", cmd_name_rev, RUN_SETUP },
345
{ "pack-objects", cmd_pack_objects, RUN_SETUP },
346
+ { "pack-redundant", cmd_pack_redundant, RUN_SETUP },
347
{ "patch-id", cmd_patch_id },
348
{ "peek-remote", cmd_ls_remote },
349
{ "pickaxe", cmd_blame, RUN_SETUP },