diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-25 14:27:08 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-25 14:27:08 -0700 |
commit | 518e8748979dbe485f519d0f63c3642cc1643f79 (patch) | |
tree | faabd0748cbacbfc92946209e5aeceb9a20884d3 | |
parent | Merge branch 'ds/object-info-for-prefetch-fix' into maint (diff) | |
parent | grep: fail if call could output and name is null (diff) | |
download | tgif-518e8748979dbe485f519d0f63c3642cc1643f79.tar.xz |
Merge branch 'es/grep-require-name-when-needed' into maint
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; |