summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-28 08:00:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-02-28 09:06:06 (GMT)
commit03a9683d22eca52bc2b2b9b09258a143e76416f6 (patch)
tree9be24a9a25e8e2702f1e27a35b0504d273ecd445 /revision.c
parent386cb77210cdb09cd808698d21d0e796cd77f26f (diff)
downloadgit-03a9683d22eca52bc2b2b9b09258a143e76416f6.zip
git-03a9683d22eca52bc2b2b9b09258a143e76416f6.tar.gz
git-03a9683d22eca52bc2b2b9b09258a143e76416f6.tar.bz2
Simplify is_kept_pack()
This removes --unpacked=<packfile> 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=<packfile> list" now says "the packfile has corresponding .keep file". Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/revision.c b/revision.c
index 795e0c0..3cfd653 100644
--- a/revision.c
+++ b/revision.c
@@ -963,16 +963,6 @@ static void add_message_grep(struct rev_info *revs, const char *pattern)
add_grep(revs, pattern, GREP_PATTERN_BODY);
}
-static void add_ignore_packed(struct rev_info *revs, const char *name)
-{
- int num = ++revs->num_ignore_packed;
-
- revs->ignore_packed = xrealloc(revs->ignore_packed,
- sizeof(const char *) * (num + 1));
- revs->ignore_packed[num-1] = name;
- revs->ignore_packed[num] = NULL;
-}
-
static int handle_revision_opt(struct rev_info *revs, int argc, const char **argv,
int *unkc, const char **unkv)
{
@@ -1072,12 +1062,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->edge_hint = 1;
} else if (!strcmp(arg, "--unpacked")) {
revs->unpacked = 1;
- free(revs->ignore_packed);
- revs->ignore_packed = NULL;
- revs->num_ignore_packed = 0;
- } else if (!prefixcmp(arg, "--unpacked=")) {
+ revs->kept_pack_only = 0;
+ } else if (!strcmp(arg, "--kept-pack-only")) {
revs->unpacked = 1;
- add_ignore_packed(revs, arg+11);
+ revs->kept_pack_only = 1;
+ } else if (!prefixcmp(arg, "--unpacked=")) {
+ die("--unpacked=<packfile> no longer supported.");
} else if (!strcmp(arg, "-r")) {
revs->diff = 1;
DIFF_OPT_SET(&revs->diffopt, RECURSIVE);