Re: [PATCH v2 08/11] rebase: remove redundant strbuf
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Sep 14, 2021, 10:33 UTC
- Message-ID
- <b6cb3935-7e6a-5440-3439-7e9076ba5051@gmail.com>
- 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:
Show 13 quoted lines
> Am 13.09.21 um 17:19 schrieb Phillip Wood via GitGitGadget:
>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
> 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