Re: [PATCH v2 2/5] pack-objects: refactor `read_packs_list_from_stdin()` to use `strmap`
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Mar 27, 2026, 18:34 UTC
- Message-ID
- <21ab7d29-5855-4830-a22d-cadfeb756cb0@gmail.com>
- In-Reply-To
- <acbDkI2vDXYu3mvL@nand.local>
On 3/27/2026 1:51 PM, Taylor Blau wrote:
> On Thu, Mar 26, 2026 at 08:29:57PM -0400, Derrick Stolee wrote: >> On 3/26/26 6:32 PM, Taylor Blau wrote:
Show 27 quoted lines
>
> fails t5331.8, which verifies that pack-objects correctly handles the
> same pack being specified as both included and excluded.
>
> But if you do the following on top of the above:
>
> --- 8< ---
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index 37c69f307d2..b6e4f950a67 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -3946,10 +3946,10 @@ static void stdin_packs_read_input(struct rev_info *revs,
> if (!info) {
> CALLOC_ARRAY(info, 1);
> strmap_put(&packs, key, info);
> -
> - info->kind |= kind;
> }
>
> + info->kind |= kind;
> +
> strbuf_reset(&buf);
> }
> --- >8 ---
>
> Then that works as expected. I agree that the end-result is a little
> easier to read, so I'll squash this into the subsequent round.Ah, yes. We should augment the flags even when finding a duplicate. That's the fatal flaw. Thanks for working through it and fixing it.
-Stolee