Merge branch 'nm/grep-object-sha1-lock'
* nm/grep-object-sha1-lock: grep: Fix race condition in delta_base_cache Conflicts: builtin/grep.c
This commit is contained in:
@ -598,8 +598,11 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
|
|||||||
struct strbuf base;
|
struct strbuf base;
|
||||||
int hit, len;
|
int hit, len;
|
||||||
|
|
||||||
|
read_sha1_lock();
|
||||||
data = read_object_with_reference(obj->sha1, tree_type,
|
data = read_object_with_reference(obj->sha1, tree_type,
|
||||||
&size, NULL);
|
&size, NULL);
|
||||||
|
read_sha1_unlock();
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
|
die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user