From 03a9683d22eca52bc2b2b9b09258a143e76416f6 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 28 Feb 2009 00:00:21 -0800 Subject: Simplify is_kept_pack() This removes --unpacked= parameter from the revision parser, and rewrites its use in git-repack to pass a single --kept-pack-only option instead. The new --kept-pack-only option means just that. When this option is given, is_kept_pack() that used to say "not on the --unpacked= list" now says "the packfile has corresponding .keep file". Signed-off-by: Junio C Hamano --- builtin-pack-objects.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'builtin-pack-objects.c') diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index 7e7719b832..150258b629 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -1915,7 +1915,7 @@ static void add_objects_in_unpacked_packs(struct rev_info *revs) const unsigned char *sha1; struct object *o; - if (is_kept_pack(p, revs)) + if (is_kept_pack(p)) continue; if (open_pack_index(p)) die("cannot open pack index"); @@ -1951,7 +1951,7 @@ static void loosen_unused_packed_objects(struct rev_info *revs) const unsigned char *sha1; for (p = packed_git; p; p = p->next) { - if (is_kept_pack(p, revs)) + if (is_kept_pack(p)) continue; if (open_pack_index(p)) @@ -2149,7 +2149,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) continue; } if (!strcmp("--unpacked", arg) || - !prefixcmp(arg, "--unpacked=") || + !strcmp("--kept-pack-only", arg) || !strcmp("--reflog", arg) || !strcmp("--all", arg)) { use_internal_rev_list = 1; -- cgit v1.2.3