From: Patrick Steinhardt Date: Tue, 15 Jul 2025 10:50:19 GMT Subject: Re: [PATCH 15/19] object-file: get rid of `the_repository` in `force_object_loose()` Message-ID: In-Reply-To: On Fri, Jul 11, 2025 at 05:38:35AM -0500, Karthik Nayak wrote: > Patrick Steinhardt writes: > > > The function `force_object_loose()` forces an object to become a loose > > object in case it only exists in its packed form. To do so it implicitly > > relies on `the_repository`. > > > > Refactor the function by passing a `struct odb_source` as parameter. > > While the check whether any such loose object exists already acts on the > > whole object database, writing the loose object happens in one specific > > source. > > > > Q: Since it exists in the packed form, won't the check always return > true? I'm not quite sure I understand the question. This function is about _ensuring_ that the object exists in its loose format. So if it only exists in a packfile, it will be written in its loose format. If it already exists as a loose object, nothing happens. Patrick