Skip to content

Commit 00723b0

Browse files
committed
Merge branch 'nm/grep-object-sha1-lock'
* nm/grep-object-sha1-lock: grep: Fix race condition in delta_base_cache Conflicts: builtin/grep.c
2 parents 1b840a5 + 8cb5775 commit 00723b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

builtin/grep.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,11 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
598598
struct strbuf base;
599599
int hit, len;
600600

601+
read_sha1_lock();
601602
data = read_object_with_reference(obj->sha1, tree_type,
602603
&size, NULL);
604+
read_sha1_unlock();
605+
603606
if (!data)
604607
die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
605608

0 commit comments

Comments
 (0)