From: Junio C Hamano Date: Sat, 10 Aug 2024 06:10:59 GMT Subject: Re: [PATCH v2 2/4] t-reftable-readwrite: use free_names() instead of a for loop Message-ID: In-Reply-To: Chandra Pratap writes: > On Sat, 10 Aug 2024 at 00:27, Junio C Hamano wrote: >> >> Chandra Pratap writes: >> >> > free_names() as defined by reftable/basics.{c,h} frees a NULL >> > terminated array of malloced strings along with the array itself. >> > Use this function instead of a for loop to free such an array. >> ... > This test is supposed to focus on reftable's read-write functionalities > so it makes sense to explicitly #include only those headers that > are directly responsible for those functionalities, namely 'reader.h', > 'blocksource.h' and 'reftable-writer.h'. 'reftable-error.h' is thrown in > there as well because some tests need to explicitly mention the > various error codes and it doesn't make sense to rely on it being > #included by others. I think we are on the same page. The code explicitly exercises free_names() after this step, and that is exactly why I found it odd to rely on basics.h happen to be included by some other header file(s) we explicitly include. Thanks.