Thread (41 messages) 41 messages, 5 authors, 14d ago

Re: [PATCH 2/4] pack-objects: ensure tree/tag closure with '--stdin-packs=follow'

flat view

From: Junio C Hamano <hidden>
Date: 2026-09-30 17:51:15

Taylor Blau [off-list ref] writes:
quoted hunk ↗ jump to hunk
@@ -4574,6 +4603,9 @@ static int add_loose_object(const struct object_id *oid, const char *path,
 
 	if (ctx && type == OBJ_COMMIT)
 		add_pending_oid(ctx->revs, NULL, oid, 0);
+	else if (ctx && ctx->mode == STDIN_PACKS_MODE_FOLLOW &&
+		 (type == OBJ_TREE || type == OBJ_TAG))
+		oid_array_append(&ctx->extra_roots, oid);
 
 	return 0;
 }
Makes me wonder if this function will always end with "if ctx is not
NULL, then depending on these conditions do one more thing" like
this, or if it would change later.  If the former,


	if (!ctx)
		return 0;

	if (type == OBJ_COMMIT)
		do the commit thing;
	else if (ctx->mode == follow && type in (tree, tag))
		do the tag or tree thing;

	return 0;

might be easier to follow, perhaps?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help