Re: [PATCH 15/19] object-file: get rid of `the_repository` in `force_object_loose()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jul 15, 2025, 10:50 UTC
- Message-ID
- <aHYya4PKoWT3-wPQ@pks.im>
- In-Reply-To
- <CAOLa=ZQ2msNYfURDXe1eNBtbFxDjmc4dJ-u1s0Fo-mqyjnnQHA@mail.gmail.com>
On Fri, Jul 11, 2025 at 05:38:35AM -0500, Karthik Nayak wrote:
Show 14 quoted lines
> Patrick Steinhardt <ps@pks.im> 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