OSDN Git Service

Merge branch 'bw/grep-recurse-submodules'
authorJunio C Hamano <gitster@pobox.com>
Mon, 6 Nov 2017 04:11:27 +0000 (13:11 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Nov 2017 04:11:27 +0000 (13:11 +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 2d65f27..5a6cfe6 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;