]> git.ipfire.org Git - thirdparty/git.git/commit - grep.h
grep: typesafe versions of grep_source_init
authorJonathan Tan <jonathantanmy@google.com>
Mon, 16 Aug 2021 21:09:53 +0000 (14:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Sep 2021 18:47:55 +0000 (11:47 -0700)
commit50d92b5f03f3c84d581b27cb8fa3a4b8cfbf2567
treeee65bc9d265a9bf36649dda4af01b7cc292acba5
parent8d33c3af0b2113091ea2c2c94990d0332c9551e7
grep: typesafe versions of grep_source_init

grep_source_init() can create "struct grep_source" objects and,
depending on the value of the type passed, some void-pointer parameters have
different meanings. Because one of these types (GREP_SOURCE_OID) will
require an additional parameter in a subsequent patch, take the
opportunity to increase clarity and type safety by replacing this
function with individual functions for each type.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/grep.c
grep.c
grep.h