From: Justin Tobler Date: Tue, 20 Oct 2026 15:51:11 GMT Subject: Re: [PATCH v3 3/4] object-file: explicitly write ".keep" lockfile Message-ID: In-Reply-To: On 26/10/20 04:26PM, Patrick Steinhardt wrote: > 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