Skip to content

Commit

Permalink
grep: slight refactoring to the code that disables threading
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vleschuk authored and gitster committed Dec 15, 2015
1 parent b6b468b commit 044b1f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions builtin/grep.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 044b1f3

Please sign in to comment.