Skip to content

Commit 044b1f3

Browse files
vleschukgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6b468b commit 044b1f3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/grep.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
801801
opt.output_priv = &path_list;
802802
opt.output = append_path;
803803
string_list_append(&path_list, show_in_pager);
804-
use_threads = 0;
805804
}
806805

807806
if (!opt.pattern_list)
@@ -832,7 +831,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
832831
}
833832

834833
#ifndef NO_PTHREADS
835-
if (list.nr || cached)
834+
if (list.nr || cached || show_in_pager)
836835
use_threads = 0;
837836
#else
838837
use_threads = 0;

0 commit comments

Comments
 (0)