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?