Hmm, there is at least one call chain in grep which might end up
calling add_to_alternates_memory() directly (although it only seems to
happen on a very specific case):
grep_submodule > repo_read_gitmodules >
config_from_gitmodules > add_to_alternates_memory
We can check that with the following:
[snip reproduction recipe]
Thanks - it looks like my patch set is incomplete then. I'll make
config_from_gitmodules() use my new function and if the existing grep
test cases don't cover your reproduction recipe, I'll add yours in.