Antonio Ospite <ao2@xxxxxx> writes: > Protecting the problematic submodules function could work for now, but > I'd like to have more comments, my proposal is: > > diff --git a/builtin/grep.c b/builtin/grep.c > index 601f801158..52b45de749 100644 > --- a/builtin/grep.c > +++ b/builtin/grep.c > @@ -427,6 +427,11 @@ static int grep_submodule(struct grep_opt *opt, struct repository *superproject, > if (repo_submodule_init(&submodule, superproject, path)) > return 0; > > + grep_read_lock(); > + /* > + * NEEDSWORK: repo_read_gitmodules accesses the object store which is > + * global, thus it needs to be protected. > + */ > repo_read_gitmodules(&submodule); > > /* > @@ -439,7 +444,6 @@ static int grep_submodule(struct grep_opt *opt, struct repository *superproject, > * store is no longer global and instead is a member of the repository > * object. > */ > - grep_read_lock(); > add_to_alternates_memory(submodule.objects->objectdir); > grep_read_unlock(); I think this is in line with how the grep codepath protects itself when doing anything that accesses the object store. Thanks.