]> git.ipfire.org Git - thirdparty/git.git/blobdiff - grep.c
Merge branch 'bb/unicode-12.1-reiwa'
[thirdparty/git.git] / grep.c
diff --git a/grep.c b/grep.c
index 0d50598acda6f1c41951d1d656ea701114473239..f7c3a5803e8ea0bf2c609e9eeec6764217641cfc 100644 (file)
--- a/grep.c
+++ b/grep.c
@@ -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;