From 918d4e1c907983d26b0c4d82d7f7abff4dbec4e5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 9 Oct 2012 16:40:03 -0700 Subject: revisions: initialize revs->grep_filter using grep_init() Instead of using the hand-rolled initialization sequence, use grep_init() to populate the necessary bits. This opens the door to allow the calling commands to optionally read grep.* configuration variables via git_config() if they want to. Signed-off-by: Junio C Hamano --- grep.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'grep.c') diff --git a/grep.c b/grep.c index 279a55933c..a947a68a7f 100644 --- a/grep.c +++ b/grep.c @@ -16,6 +16,11 @@ static struct grep_opt grep_defaults; void init_grep_defaults(void) { struct grep_opt *opt = &grep_defaults; + static int run_once; + + if (run_once) + return; + run_once++; memset(opt, 0, sizeof(*opt)); opt->relative = 1; -- cgit v1.2.1