summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-26 19:15:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-26 20:09:23 (GMT)
commit764161391f2dd3fc12a5bec1385e0ab40dd90fd6 (patch)
tree76a2fcca03e6df07832603195cac66ff6c499c65
parent1487a12ba228c6003f503366f40840eee9887179 (diff)
downloadgit-764161391f2dd3fc12a5bec1385e0ab40dd90fd6.zip
git-764161391f2dd3fc12a5bec1385e0ab40dd90fd6.tar.gz
git-764161391f2dd3fc12a5bec1385e0ab40dd90fd6.tar.bz2
builtin/grep: simplify lock_and_read_sha1_file()
As read_sha1_lock/unlock have been made aware of use_threads, this caller can be made a lot simpler. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/grep.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 3ddfae4..3d7329d 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -373,13 +373,9 @@ static void *lock_and_read_sha1_file(const unsigned char *sha1, enum object_type
{
void *data;
- if (use_threads) {
- read_sha1_lock();
- data = read_sha1_file(sha1, type, size);
- read_sha1_unlock();
- } else {
- data = read_sha1_file(sha1, type, size);
- }
+ read_sha1_lock();
+ data = read_sha1_file(sha1, type, size);
+ read_sha1_unlock();
return data;
}