diff mbox series

[WIP,v2,3/4] revision: don't mark commit as UNINTERESTING if --exclude-promisor-objects is set

Message ID 20240823124354.12982-4-hanyang.tony@bytedance.com (mailing list archive)
State New
Headers show
Series revision: fix reachable objects being gc'ed in no blob clone repo | expand

Commit Message

Han Young Aug. 23, 2024, 12:43 p.m. UTC
if commit is marked as UNINTERESTING, the bit will propagate down to its
parents. This is undesirable in --exclude-promisor-objects, since a promisor
objects' parents can be a normal object.
---
 revision.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/revision.c b/revision.c
index 7bb03a84c2..02227e6a0a 100644
--- a/revision.c
+++ b/revision.c
@@ -3609,7 +3609,9 @@  static int mark_uninteresting(const struct object_id *oid,
 {
 	struct rev_info *revs = cb;
 	struct object *o = lookup_unknown_object(revs->repo, oid);
-	o->flags |= UNINTERESTING | SEEN;
+	if (o->type != OBJ_COMMIT)
+		o->flags |= UNINTERESTING | SEEN;
+
 	return 0;
 }