Re: [PATCH v3 08/11] odb/transaction: add transaction env interface
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Jul 9, 2026, 15:02 UTC
- Message-ID
- <ak-vJ2hlAHLbg8Zb@denethor>
- In-Reply-To
- <xmqqbjcgrg0e.fsf@gitster.g>
On 26/07/08 08:36PM, Junio C Hamano wrote:
Show 17 quoted lines
> Justin Tobler <jltobler@gmail.com> writes:
>
> > +static int odb_transaction_files_env(struct odb_transaction *base,
> > + struct strvec *env)
> > +{
> > + struct odb_transaction_files *transaction =
> > + container_of(base, struct odb_transaction_files, base);
> > +
> > + odb_transaction_files_prepare(&transaction->base);
>
> Can this fail? The caller of us would not notice that something
> went wrong, and ...
>
> > + strvec_pushv(env, tmp_objdir_env(transaction->objdir));
>
> ... happily ends up using transaction->objdir that may not be
> appropriate for it to use if it fails, no?Ya, `odb_transaction_files_prepare()` can fail here. In practice, failure results in no temporary directory being created which `tmp_objdir_env()` does handle gracefully, but we should ideally still be reported the failure back to callers. Will update in the next version.
-Justin