Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Koppe <andy.koppe@gmail.com>2023-10-08 23:23:07 +0300
committerJunio C Hamano <gitster@pobox.com>2023-10-09 21:25:13 +0300
commit2b09d16abac5c0cf389098a58f113f2053357dee (patch)
tree6c8a28f42e2dac4980c8dcfe122acf277d98b3a0 /pretty.c
parent1e63b34a449afd650b02ab19501e8ccf0c15816e (diff)
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>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 7f3abb676c..cf964b060c 100644
--- a/pretty.c
+++ b/pretty.c
@@ -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;
}
}
}