Re: [PATCH 09/10] set_git_dir: handle feeding gitdir to itself

2017-09-07 Thread Brandon Williams
On 09/05, Jeff King wrote: > Ideally we'd free the existing gitdir field before assigning > the new one, to avoid a memory leak. But we can't do so > safely because some callers do the equivalent of: > > set_git_dir(get_git_dir()); > > We can detect that case as a noop, but there are even more

[PATCH 09/10] set_git_dir: handle feeding gitdir to itself

2017-09-05 Thread Jeff King
Ideally we'd free the existing gitdir field before assigning the new one, to avoid a memory leak. But we can't do so safely because some callers do the equivalent of: set_git_dir(get_git_dir()); We can detect that case as a noop, but there are even more complicated cases like: