diff options
author | Victor Leschuk <vleschuk@gmail.com> | 2015-12-15 18:31:39 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-12-15 10:49:57 -0800 |
commit | 044b1f3cb4ff09551f6c514ed02edafa6c4987b0 (patch) | |
tree | ef1a27383553feda67e5543b0e081592eda05506 /builtin/grep.c | |
parent | grep: allow threading even on a single-core machine (diff) | |
download | tgif-044b1f3cb4ff09551f6c514ed02edafa6c4987b0.tar.xz |
grep: slight refactoring to the code that disables threading
When show-in-pager option is used, threading is unconditionally
disabled, but this happened much earlier than the code that
determines the use of threading based on the operand (i.e. we do not
thread search in the object database). Consolidate the code to
disable threading to just one place.
Signed-off-by: Victor Leschuk <vleschuk@accesssoftek.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 734d6ceaae..a892967467 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -801,7 +801,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix) opt.output_priv = &path_list; opt.output = append_path; string_list_append(&path_list, show_in_pager); - use_threads = 0; } if (!opt.pattern_list) @@ -832,7 +831,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix) } #ifndef NO_PTHREADS - if (list.nr || cached) + if (list.nr || cached || show_in_pager) use_threads = 0; #else use_threads = 0; |