From: Phillip Wood Date: Tue, 14 Sep 2021 10:33:57 GMT Subject: Re: [PATCH v2 08/11] rebase: remove redundant strbuf Message-ID: In-Reply-To: <3c7c5560-2cae-a4cf-a298-6d77a3fb9226@web.de> Hi René Thanks for looking at this series On 13/09/2021 19:34, René Scharfe wrote: > Am 13.09.21 um 17:19 schrieb Phillip Wood via GitGitGadget: >> From: Phillip Wood > I'd rather see the use of that multi-purpose "buf" reduced, e.g. we > could simplify path-building like this in a few cases: > > - strbuf_reset(&buf); > - strbuf_addf(&buf, "%s/applying", apply_dir()); > - if(file_exists(buf.buf)) > + if (file_exists(mkpath("%s/applying", apply_dir()))) > > Sure, this looks a bit lispy, but still better than the old code > because there is no state to carry around and reset when "buf" is > repurposed. That's a nice suggestion, I think it's much clearer which file we're checking for. Best Wishes Phillip