diff options
author | Martin Ågren <martin.agren@gmail.com> | 2020-11-21 21:31:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-22 01:50:33 +0300 |
commit | 96313423a75fa8d88b6ecd5a15c21a7fbaf9e9be (patch) | |
tree | 19f731ed362d59f349c88f420ac5d41c0f9acc5e /revision.c | |
parent | 1d3878799f8260968ea9f6a75a92c4daca1da133 (diff) |
grep: use designated initializers for `grep_defaults`
In 15fabd1bbd ("builtin/grep.c: make configuration callback more
reusable", 2012-10-09), we learned to fill a `static struct grep_opt
grep_defaults` which we can use as a blueprint for other such structs.
At the time, we didn't consider designated initializers to be widely
useable, but these days, we do. (See, e.g., cbc0f81d96 ("strbuf: use
designated initializers in STRBUF_INIT", 2017-07-10).)
Use designated initializers to let the compiler set up the struct and so
that we don't need to remember to call `init_grep_defaults()`.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/revision.c b/revision.c index f35ea1db11..963868f699 100644 --- a/revision.c +++ b/revision.c @@ -1834,7 +1834,6 @@ void repo_init_revisions(struct repository *r, revs->commit_format = CMIT_FMT_DEFAULT; revs->expand_tabs_in_log_default = 8; - init_grep_defaults(); grep_init(&revs->grep_filter, revs->repo, prefix); revs->grep_filter.status_only = 1; |