summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-25 12:23:44 -0700
committerJunio C Hamano <gitster@pobox.com>2011-05-25 13:08:10 -0700
commita6253d107734c7ffa6d939307d87cf496795dc78 (patch)
tree5d73f7c11255fd23200239311ebcbcf2b9570dce /pretty.c
parent9963e025e88f134cf07ef348d80a5821c69a7eb0 (diff)
downloadgit-a6253d107734c7ffa6d939307d87cf496795dc78.tar.gz
userformat_find_requirements(): find requirement for the correct format
This function was introduced in 5b16360 (pretty: Initialize notes if %N is used, 2010-04-13) to check what kind of information the "log --format=..." user format string wants. The function can be passed a NULL instead of a format string to ask it to check user_format variable kept by an earlier call to save_user_format(). But it unconditionally checked user_format and not the string it was given. The only caller introduced by the change passes NULL, which kept the bug unnoticed, until a new GCC noticed that there is an assignment to fmt that is never used. Noticed-by: Chris Wilson's compiler Signed-off-by: Junio C Hamano <gitster@pobox.com> Acked-by: Jeff King <peff@peff.net>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pretty.c b/pretty.c
index 13618d8264..7d23c1f848 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1075,7 +1075,7 @@ void userformat_find_requirements(const char *fmt, struct userformat_want *w)
return;
fmt = user_format;
}
- strbuf_expand(&dummy, user_format, userformat_want_item, w);
+ strbuf_expand(&dummy, fmt, userformat_want_item, w);
strbuf_release(&dummy);
}