Re: [PATCH v2 2/6] midx-write: put failing response value back
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Sep 5, 2025, 19:03 UTC
- Message-ID
- <18ff26d7-6e9d-4a8d-9d58-aff69ee8b2bb@gmail.com>
- In-Reply-To
- <aLgVLMnbGiUAviXZ@pks.im>
On 9/3/2025 6:15 AM, Patrick Steinhardt wrote:
Show 15 quoted lines
> On Sat, Aug 30, 2025 at 09:23:23PM +0000, Derrick Stolee via GitGitGadget wrote:
>> diff --git a/midx-write.c b/midx-write.c
>> index 070a7f61f4..0f1d5653ab 100644
>> --- a/midx-write.c
>> +++ b/midx-write.c
>> @@ -1104,6 +1104,7 @@ static int write_midx_internal(struct repository *r, const char *object_dir,
>> m = m->base_midx;
>> }
>> } else if (ctx.m && fill_packs_from_midx(&ctx)) {
>> + result = 1;
>> goto cleanup;
>> }
>
> Would it make sense to also convert this command to return negative
> error codes?(Yes, in patch 6)
Show 15 quoted lines
>> diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh >> index 49705c62a2..008e65c22e 100755 >> --- a/t/t5319-multi-pack-index.sh >> +++ b/t/t5319-multi-pack-index.sh >> @@ -1100,7 +1100,10 @@ test_expect_success 'load reverse index when missing .idx, .pack' ' >> mv $idx.bak $idx && >> >> mv $pack $pack.bak && >> - git cat-file --batch-check="%(objectsize:disk)" <tip >> + git cat-file --batch-check="%(objectsize:disk)" <tip && >> + >> + test_must_fail git multi-pack-index write 2>err && >> + grep "could not load pack" err > > Nit: this should probably use `test_grep`.
You're right. I think I misremembered the preferred use back when test_i18ngrep was deprecated.
Thanks, -Stolee