grep: simplify grep_oid and grep_file
commit38ef24dccfb696393d2e8e701bf2f81c9e6275e2
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Fri, 23 Feb 2018 14:47:57 +0000 (23 15:47 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Feb 2018 20:23:50 +0000 (23 12:23 -0800)
tree437d07d912e8f2966dc52aab67e8c9c9af15b8e5
parente2e05d619a71ae2c06ebd3c661260bf4b5039a93
grep: simplify grep_oid and grep_file

In the NO_PTHREADS or !num_threads case, this doesn't change
anything. In the threaded case, note that grep_source_init duplicates
its third argument, so there is no need to keep [path]buf.buf alive
across the call of add_work().

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c