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>

Victor Leschuk committed Dec 15, 2015 at 18:31 UTC 044b1f3cb4ff09551f6c514ed02edafa6c4987b0
1 file changed +1 -2
builtin/grep.c
+1 -2
@@ -801,7 +801,6 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
801 opt.output_priv = &path_list;
802 opt.output = append_path;
803 string_list_append(&path_list, show_in_pager);
804 - use_threads = 0;
804 }
805
806 if (!opt.pattern_list)
@@ -832,7 +831,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
831 }
832
833 #ifndef NO_PTHREADS
835 - if (list.nr || cached)
834 + if (list.nr || cached || show_in_pager)
835 use_threads = 0;
836 #else
837 use_threads = 0;