Merge branch 'bw/grep-recurse-submodules' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 15 Nov 2017 03:04:55 +0000 (12:04 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Nov 2017 03:04:55 +0000 (12:04 +0900)
A broken access to object databases in recent update to "git grep
--recurse-submodules" has been fixed.

* bw/grep-recurse-submodules:
grep: take the read-lock when adding a submodule

builtin/grep.c
index 2d65f27d01f3da772f7bad21f101fdc0af0102ed..5a6cfe6b45b06b6b75ea399a83cb8dcf7e197141 100644 (file)
@@ -431,7 +431,9 @@ 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.objectdir);
+       grep_read_unlock();
 
        if (oid) {
                struct object *object;