summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-03-11 20:49:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-03-11 20:49:56 (GMT)
commitaec813062b340e6bb181470cf57cc4b4406e1bb8 (patch)
treebb2b33ca6b89fdfd8d0e4b2e6d34f5a806674b67 /revision.c
parent8f4cc7911955a3642af601394a4b4473e7bfde33 (diff)
parent69e020ae00ebd3f7ae3c2f35acb139361417ef64 (diff)
downloadgit-aec813062b340e6bb181470cf57cc4b4406e1bb8.zip
git-aec813062b340e6bb181470cf57cc4b4406e1bb8.tar.gz
git-aec813062b340e6bb181470cf57cc4b4406e1bb8.tar.bz2
Merge branch 'jc/maint-1.6.0-keep-pack'
* jc/maint-1.6.0-keep-pack: is_kept_pack(): final clean-up Simplify is_kept_pack() Consolidate ignore_packed logic more has_sha1_kept_pack(): take "struct rev_info" has_sha1_pack(): refactor "pretend these packs do not exist" interface git-repack: resist stray environment variable
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/revision.c b/revision.c
index c4efe5b..f5771c7 100644
--- a/revision.c
+++ b/revision.c
@@ -994,16 +994,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)
{
@@ -1116,12 +1106,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);
@@ -1689,7 +1679,10 @@ enum commit_action simplify_commit(struct rev_info *revs, struct commit *commit)
{
if (commit->object.flags & SHOWN)
return commit_ignore;
- if (revs->unpacked && has_sha1_pack(commit->object.sha1, revs->ignore_packed))
+ if (revs->unpacked &&
+ (revs->kept_pack_only
+ ? has_sha1_kept_pack(commit->object.sha1)
+ : has_sha1_pack(commit->object.sha1)))
return commit_ignore;
if (revs->show_all)
return commit_show;