diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-06-17 10:15:14 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-17 10:15:14 -0700 |
commit | ac97dc4fa9869146f774f6df854e23afb38e15cd (patch) | |
tree | bd3bcb0d59d91617c8764834547d6dd3e0b8cbdd | |
parent | 7df94cd1f691dd6ccb3038e1b77544030aab3fed (diff) | |
parent | de99eb0c24d96730de187edd37b9ca9d42b0b05d (diff) | |
download | git-ac97dc4fa9869146f774f6df854e23afb38e15cd.tar.gz |
Merge branch 'es/grep-require-name-when-needed'
More parameter validation.
* es/grep-require-name-when-needed:
grep: fail if call could output and name is null
-rw-r--r-- | grep.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1780,6 +1780,10 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle enum grep_context ctx = GREP_CONTEXT_HEAD; xdemitconf_t xecfg; + if (!opt->status_only && gs->name == NULL) + BUG("grep call which could print a name requires " + "grep_source.name be non-NULL"); + if (!opt->output) opt->output = std_output; |