pretty: fix ref filtering for %(decorate) formats

Mark pretty formats containing "%(decorate" as requiring decoration in
userformat_find_requirements(), same as "%d" and "%D".

Without this, cmd_log_init_finish() didn't invoke load_ref_decorations()
with the decoration_filter it puts together, and hence filtering options
such as --decorate-refs were quietly ignored.

Amend one of the %(decorate) checks in t4205-log-pretty-formats.sh to
test this.

Signed-off-by: Andy Koppe <andy.koppe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Andy Koppe
2023-10-08 21:23:07 +01:00
committed by Junio C Hamano
parent 1e63b34a44
commit 2b09d16aba
2 changed files with 7 additions and 3 deletions

View File

@@ -1961,6 +1961,10 @@ void userformat_find_requirements(const char *fmt, struct userformat_want *w)
case 'D':
w->decorate = 1;
break;
case '(':
if (starts_with(fmt + 1, "decorate"))
w->decorate = 1;
break;
}
}
}