Merge branch 'bb/grep-pcre2-bug-message-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 Jul 2019 19:39:13 +0000 (12:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jul 2019 19:39:13 +0000 (12:39 -0700)
BUG() message fix.

The codepath may want to just simply be removed, though.

* bb/grep-pcre2-bug-message-fix:
grep: print the pcre2_jit_on value

1  2 
grep.c
diff --combined grep.c
index f7c3a5803e8ea0bf2c609e9eeec6764217641cfc,c2bce6c2c7b6160331c18dff7744b6e180e1d922..cd952ef5d3cca5ab66f432736881d98a94323014
--- 1/grep.c
--- 2/grep.c
+++ b/grep.c
@@@ -559,7 -559,7 +559,7 @@@ static void compile_pcre2_pattern(struc
                pcre2_jit_stack_assign(p->pcre2_match_context, NULL, p->pcre2_jit_stack);
        } else if (p->pcre2_jit_on != 0) {
                BUG("The pcre2_jit_on variable should be 0 or 1, not %d",
-                   p->pcre1_jit_on);
+                   p->pcre2_jit_on);
        }
  }
  
@@@ -1780,10 -1780,6 +1780,10 @@@ static int grep_source_1(struct grep_op
        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;
  
                 * is not thread-safe.
                 */
                grep_attr_lock();
 -              textconv = userdiff_get_textconv(gs->driver);
 +              textconv = userdiff_get_textconv(opt->repo, gs->driver);
                grep_attr_unlock();
        }