1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-04-28 16:55:09 +02:00

Merge branch 'az/grep-group-error-message-update' into next

Error message clarification.

* az/grep-group-error-message-update:
  grep: improve errors for unmatched ( and )
This commit is contained in:
Junio C Hamano 2024-03-27 10:13:03 -07:00
commit 567bf00ed4

4
grep.c
View File

@ -621,7 +621,7 @@ static struct grep_expr *compile_pattern_atom(struct grep_pat **list)
*list = p->next;
x = compile_pattern_or(list);
if (!*list || (*list)->token != GREP_CLOSE_PAREN)
die("unmatched parenthesis");
die("unmatched ( for expression group");
*list = (*list)->next;
return x;
default:
@ -792,7 +792,7 @@ void compile_grep_patterns(struct grep_opt *opt)
if (p)
opt->pattern_expression = compile_pattern_expr(&p);
if (p)
die("incomplete pattern expression: %s", p->pattern);
die("incomplete pattern expression group: %s", p->pattern);
if (opt->no_body_match && opt->pattern_expression)
opt->pattern_expression = grep_not_expr(opt->pattern_expression);