From: Kaartic Sivaraam Date: Mon, 28 Sep 2026 12:19:20 GMT Subject: Re: [PATCH v2 0/7] setup: enforce repo passed to `create_repository()` has no state Message-ID: <886d145f-ac38-4079-8a96-f09904fc3b10@gmail.com> In-Reply-To: On 9/28/26 17:45, Kaartic Sivaraam wrote: > On 9/28/26 15:21, Patrick Steinhardt wrote: >> >> [... snip ...] > > >> 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/ Oops. I meant s/free(3p)/free(3)/ > > Rest of the inter-diff looks neat. > -- Sivaraam