Subject: Re: [PATCH] update-index: Don't copy memory around

From: Junio C Hamano <[email-masked]>
Date: Mon, 23 Mar 2015 10:11:08 -0700

Stefan Beller <[email-masked]> writes:

> ... though I do not understand
> why. This passes the test suite, so I wonder if this patch would be a subtle bug
> now.

I recall the last time I traced the code I noticed that the ce can
get passed to a codepath that causes its removal from update_one(),
and then the pathname itself (which used to be ce->name but remember
that ce is invalid already at that point!) is still used after ce is
removed, which was the reason why you would introduce a bug if you
stop copying the path. You may have to follow the code again a bit
closer to make sure but I am reasonably sure that was the reason.