Subject: Re: [PATCH 4/5] pack-objects: support excluded-open packs with --stdin-packs

From: Jeff King <[email-masked]>
Date: Sat, 21 Mar 2026 12:57:11 -0400

On Thu, Mar 19, 2026 at 06:24:25PM -0400, Taylor Blau wrote:

> @@ -3750,8 +3756,6 @@ static int add_object_entry_from_pack(const struct object_id *oid,
>  		return 0;
>  
>  	ofs = nth_packed_object_offset(p, pos);
> -	if (!want_object_in_pack(oid, 0, &p, &ofs))
> -		return 0;
>  
>  	if (p) {
>  		struct object_info oi = OBJECT_INFO_INIT;

I haven't read all of the patches carefully yet, but Coverity observed
that without this call to want_object_in_pack(), we are left with "p"
that came from the caller. If that "p" is ever NULL, then the
nth_packed_object_offset() call above will segfault. But if it is not,
then the "if (p)" below is pointless.

AFAICT it will never be NULL, and the conditional is now pointless. But
it wasn't before your patch, since want_object_in_pack() may set the
found_pack to NULL if the object is not wanted.

-Peff