Re: [PATCH] rm: do not set a variable twice without intermediate reading.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 23, 2013, 19:01 UTC
- Message-ID
- <7vzjtd6qya.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <51EECFBB.3050406@googlemail.com>
Stefan Beller <stefanbeller@googlemail.com> writes:
Show 13 quoted lines
> On 07/23/2013 08:32 PM, Junio C Hamano wrote:
>> Interesting. This is ancient and dates back to 7612a1ef (git-rm:
>> honor -n flag., 2006-06-08).
> Originally it comes from d9b814cc97 (by Linus), which introduced:
> + seen = NULL;
> + if (pathspec) {
> + for (i = 0; pathspec[i] ; i++)
> + /* nothing */;
> + seen = xmalloc(i);
> + memset(seen, 0, i);
> + }
>
> Then in 7612a1efdb0c the second seen assignment was made unconditional.That is why I blamed the bug to 7612a1ef. Before that, without pathspec, directory traversal function were told not to report which ones were seen and which ones were not by passing seen=NULL.