@@ -2701,6 +2701,11 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
if (fetch_if_missing)
BUG("exclude_promisor_objects can only be used when fetch_if_missing is 0");
revs->exclude_promisor_objects = 1;
+ } else if (opt && opt->allow_exclude_promisor_objects &&
+ !strcmp(arg, "--exclude-promisor-pack-objects")) {
+ if (fetch_if_missing)
+ BUG("exclude_promisor_pack_objects can only be used when fetch_if_missing is 0");
+ revs->exclude_promisor_pack_objects = 1;
} else {
int opts = diff_opt_parse(&revs->diffopt, argv, argc, revs->prefix);
if (!opts)
@@ -3908,7 +3913,7 @@ int prepare_revision_walk(struct rev_info *revs)
(revs->limited && limiting_can_increase_treesame(revs)))
revs->treesame.name = "treesame";
- if (revs->exclude_promisor_objects) {
+ if (revs->exclude_promisor_objects || revs->exclude_promisor_pack_objects) {
for_each_packed_object(mark_uninteresting, revs,
FOR_EACH_OBJECT_PROMISOR_ONLY);
}
@@ -4275,6 +4280,12 @@ static struct commit *get_revision_1(struct rev_info *revs)
if (!commit)
return NULL;
+ if (revs->exclude_promisor_objects && is_promisor_object(&commit->object.oid))
+ continue;
+
+ if (revs->exclude_promisor_pack_objects && is_in_promisor_pack(&commit->object.oid, 0))
+ continue;
+
if (revs->reflog_info)
commit->object.flags &= ~(ADDED | SEEN | SHOWN);
@@ -229,7 +229,8 @@ struct rev_info {
do_not_die_on_missing_objects:1,
/* for internal use only */
- exclude_promisor_objects:1;
+ exclude_promisor_objects:1,
+ exclude_promisor_pack_objects:1;
/* Diff flags */
unsigned int diff:1,