Subject: Re: [PATCH v2] run-command: wean start_command() off the_repository

From: Patrick Steinhardt <[email-masked]>
Date: Thu, 12 Mar 2026 11:01:03 +0100

On Thu, Mar 12, 2026 at 11:53:41AM +0300, Burak Kaan Karaçay wrote:
> The start_command() relies on the_repository due to the
> close_object_store flag in 'struct child_process'. When this flag is
> set, start_command() closes the object store associated with
> the_repository before spawning a child process.
> 
> To eliminate this dependency, replace the 'close_object_store' with the
> new 'odb_to_close' field. This allows callers to specify the object
> store that needs to be closed.

I really like this solution.

There's now only a single other function that still uses
`the_repository` in `prepare_auto_maintenance()`. Do we maybe want to
add a second commit that converts this function and its caller
`run_auto_maintenance()` to receive the repository as parameter so that
we can drop the `USE_THE_REPOSITORY_VARIABLE` declaration?

Thanks!

Patrick