Re: [PATCH v3 3/4] object-file: explicitly write ".keep" lockfile
- From
Justin Tobler <jltobler@gmail.com>
- Date
- Oct 20, 2026, 15:51 UTC
- Message-ID
- <ateNY8W17UAVPZ9b@denethor>
- In-Reply-To
- <atd6IjqH8F_O44gP@pks.im>
On 26/10/20 04:26PM, Patrick Steinhardt wrote:
Show 13 quoted lines
> On Tue, Oct 20, 2026 at 08:28:59AM -0500, Justin Tobler wrote:
> > +static int write_pack_lockfile(struct odb_source *source, const char *pack_name,
> > + const char *keep_msg)
> > +{
> > + struct strbuf lock_path = STRBUF_INIT;
> > + struct strbuf contents = STRBUF_INIT;
> > + int ret = 0;
> > + int fd;
>
> Hum, not quite what I meant :P I'd leave the variable explicitly
> uninitialized and then set it on all exit paths. Like that, the compiler
> (or at least most common compilers) would warn for all code paths where
> we don't set the error code.Apologies, I should have read your suggestion more closely. I don't mind sending another version correcting this though.
-Justin