Subject: Re: [PATCH 07/20] stash: fix a "struct pathspec" leak

From: Junio C Hamano <[email-masked]>
Date: Thu, 29 Dec 2022 16:02:59 +0900

René Scharfe <[email-masked]> writes:

> Am 28.12.22 um 19:00 schrieb Ævar Arnfjörð Bjarmason:
>> Call clear_pathspec() on the pathspec initialized in
>> push_stash().
>
> This puzzled me for a while.  This patch adds an {0} initializer to the
> declaration of the pathspec.  I assumed that this is necessary to avoid
> giving clear_pathspec() an uninitialized struct.  It isn't, though,
> because the pathspec is handed to parse_pathspec() first, which
> initializes it.  So you can safely drop the first hunk.

It did mislead me too.  I expected that addition of "= { 0 }" was to
remove memset('\0') somewhere else, but that is not the case.