diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-15 20:46:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-15 20:46:37 -0700 |
commit | 7c4f050ae1e140a81f66b5cf92ad2c8673cfda8b (patch) | |
tree | 744d04ea9231630c040e40c18a7a5899ed973700 /builtin | |
parent | fc26f57b847b86ba330ea543a6dfc86a10d4cce3 (diff) | |
parent | 8cb5775b2b9885708c3f646a1e273de1ac778a88 (diff) | |
download | git-7c4f050ae1e140a81f66b5cf92ad2c8673cfda8b.tar.gz git-7c4f050ae1e140a81f66b5cf92ad2c8673cfda8b.tar.xz |
Merge branch 'nm/grep-object-sha1-lock' into maint
* nm/grep-object-sha1-lock:
grep: Fix race condition in delta_base_cache
Conflicts:
builtin/grep.c
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/grep.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 1c359c267..a286692e4 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -598,8 +598,11 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec, struct strbuf base; int hit, len; + read_sha1_lock(); data = read_object_with_reference(obj->sha1, tree_type, &size, NULL); + read_sha1_unlock(); + if (!data) die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1)); |