]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/grep.c
convert git-grep to use grep_source interface
authorJeff King <peff@peff.net>
Thu, 2 Feb 2012 08:19:37 +0000 (03:19 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Feb 2012 18:36:08 +0000 (10:36 -0800)
commit8f24a6323ece9be1bf1a04b4b5856112438337f2
tree0a6728ca7f560af5b8bccbfac32f059c758414ac
parente1327023ea22c3bf57e7d28596da356043f073fc
convert git-grep to use grep_source interface

The grep_source interface (as opposed to grep_buffer) will
eventually gives us a richer interface for telling the
low-level grep code about our buffers. Eventually this will
lead to things like better binary-file handling. For now, it
lets us drop a lot of now-redundant code.

The conversion is mostly straight-forward. One thing to note
is that the memory ownership rules for "struct grep_source"
are different than the "struct work_item" found here (the
former will copy things like the filename, rather than
taking ownership). Therefore you will also see some slight
tweaking of when filename buffers are released.

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