grep: move thread initialization a little lower
commita0fe2b0d2329d38a08c03427917b21be818bec1f
authorJeff King <peff@peff.net>
Tue, 14 Feb 2017 06:02:38 +0000 (14 01:02 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Feb 2017 19:13:25 +0000 (14 11:13 -0800)
tree6c2efa91a54f215f91b8dd0cc7c6749e7ff6be2b
parent5588dbffbd61e4906e453808c6ad32f792fea521
grep: move thread initialization a little lower

Originally, we set up the threads for grep before parsing
the non-option arguments. In 53b8d931b (grep: disable
threading in non-worktree case, 2011-12-12), the thread code
got bumped lower in the function because it now needed to
know whether we got any revision arguments.

That put a big block of code in between the parsing of revs
and the parsing of pathspecs, both of which share some loop
variables. That makes it harder to read the code than the
original, where the shared loops were right next to each
other.

Let's bump the thread initialization until after all of the
parsing is done.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c