projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1487a12
)
builtin/grep: simplify lock_and_read_sha1_file()
author
Junio C Hamano
<gitster@pobox.com>
Wed, 26 Oct 2011 19:15:51 +0000
(12:15 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 26 Oct 2011 20:09:23 +0000
(13:09 -0700)
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>
builtin/grep.c
patch
|
blob
|
history
diff --git
a/builtin/grep.c
b/builtin/grep.c
index 3ddfae4e79b5092a211608f25b6ded9b522d9f99..3d7329d78c6e3ec31ed8ce03b8928c9ed24afb9e 100644
(file)
--- 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;
}