@matheusbsbs / matheus-bagliano / commits / 95a2618f60
Fork 0

pretty: initialize new cmt_fmt_map to 0

Without this change, is_alias is likely to happen to be nonzero, resulting in "fatal: invalid --pretty format" when the fake alias cannot be resolved. Use memset instead of initializing the members one by one to make it easier to expand the struct in the future if needed. t4205 (log --pretty) does not pass for me without this fix. Cc: Will Palmer <wmpalmer@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Nieder committed May 8, 2010 at 16:07 UTC 95a2618f60a61fae8097695255419f257f74dff9
1 file changed +1
pretty.c
+1
@@ -59,6 +59,7 @@ static int git_pretty_formats_config(const char *var, const char *value, void *c
59 ALLOC_GROW(commit_formats, commit_formats_len+1,
60 commit_formats_alloc);
61 commit_format = &commit_formats[commit_formats_len];
62 + memset(commit_format, 0, sizeof(*commit_format));
63 commit_formats_len++;
64 }
65