Re: [PATCH v2 0/7] setup: enforce repo passed to `create_repository()` has no state
- From
Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
- Date
- Sep 28, 2026, 12:15 UTC
- Message-ID
- <b0ec2ef9-7aef-4f7d-b31b-7141b39c2d24@gmail.com>
- In-Reply-To
- <20260928-pks-create-repository-stateless-v2-0-a03612f703fa@pks.im>
On 9/28/26 15:21, Patrick Steinhardt wrote:
> > [... snip ...]
>
Show 13 quoted lines
> 3: 3a7c197f1b = 3: 8dd89f144a builtin/init: refactor messy creation of leading directories > 4: c3ced666bd = 4: f37db1b17d builtin/init: move handling of "core.sharedRepository" into "setup.c" > 5: 25918a4ff6 = 5: db76d32f2c builtin/clone: don't apply "core.sharedRepository" to leading dirs > 6: a742852675 ! 6: 19388a188c repository: adapt `repo_clear()` to fully reset the repository > @@ Commit message > some state because we don't make sure to clear the whole structure. > > Refactor the function to set the whole repository to all-zeroes to avoid > - any kind of leaking state. While at it, make it a bit more robust when > - called on an already-blank repository. > + any kind of leaking state. Replace calls of `FREE_AND_NULL()` to instead > + use free(3p) to avoid zeroing out the data twice. >
s/free(3p)/free/ Rest of the inter-diff looks neat.
-- Sivaraam