Subject: Re: [PATCH v2 04/10] diffcore-rename: extend cleanup_dir_rename_info()

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Thu, 25 Feb 2021 03:26:52 +0100

On Thu, Feb 25 2021, Ævar Arnfjörð Bjarmason wrote:

>     -		partial_clear_dir_rename_count(&renames->dir_rename_count[i]);
>     -		if (!reinitialize)
>     -			strmap_clear(&renames->dir_rename_count[i], 1);
>     +		partial_clear_dir_rename_count(&renames->dir_rename_count[i],
>     +					       !reinitialize);
>     +		free(&renames->dir_rename_count[i]);
>      
>      		strmap_func(&renames->dir_renames[i], 0);
>      	}

That free() wasn't supposed to be in there, I was still experimenting
with whether partial_clear_dir_rename_count() should also free() this
itself.

But now that I notice I left that in there and in the meantime ran all
the tests, they all passed. So maybe this & the if/else in
diffcore_rename_extended() can lose its braces by just calling either
cleanup_dir_rename_info() or partial_clear_dir_rename_count(). I didn't
look in any detail, and if the free() v.s. FREE_AND_NULL() distinction
mattered here.