1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-09-11 15:05:30 +03:00

fix: add legacy fix for body field

This commit is contained in:
Jan Max Tiedemann 2024-08-06 03:20:27 +02:00
parent 32da6d3903
commit 208f0b9adf
No known key found for this signature in database
GPG Key ID: 35419F9118F39403

View File

@ -294,9 +294,15 @@ impl Commit<'_> {
if let (Some(field_name), Some(pattern_regex)) =
(parser.field.as_ref(), parser.pattern.as_ref())
{
match tera::dotted_pointer(&lookup_context, field_name) {
let value = if field_name == "body" {
body.clone()
} else {
tera::dotted_pointer(&lookup_context, field_name)
.map(|v| v.to_string())
};
match value {
Some(value) => {
regex_checks.push((pattern_regex, value.to_string()));
regex_checks.push((pattern_regex, value));
}
None => {
return Err(AppError::FieldError(format!(