On Mon, Aug 10, 2015 at 02:05:14PM +0200, Michael Haggerty wrote:
I was wondering whether this memoization could interact badly with
update_common_dir(). For example, if any of the memoized functions were
called before git_common_dir is initialized, then the pre-git_common_dir
value would continue to be used even if git_common_dir is changed
afterwards. But I believe it is taboo to call git_path() before
setup_git_env(), so I think this is not a problem.
Calling git_path() actually ends up in setup_git_env(), because we
lazily call it from get_git_dir(). So if somebody tries to tweak
common_dir stuff too late, we could in theory cache a bogus value; but
the real problem is generating the bogosity in the first place.
-Peff