From: Eric Wong Date: Fri, 2 Feb 2007 13:10:25 +0000 (-0800) Subject: Disallow invalid --pretty= abbreviations X-Git-Tag: v1.5.0-rc4~74 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b6936205e73c058784288d21d1937e5bba26b91b;p=git.git Disallow invalid --pretty= abbreviations --pretty=o is a valid abbreviation, --pretty=omfg is not Noticed by: Nicolas Vilz Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- diff --git a/commit.c b/commit.c index 9b2b842e7..3e8c87294 100644 --- a/commit.c +++ b/commit.c @@ -47,7 +47,8 @@ enum cmit_fmt get_commit_format(const char *arg) if (*arg == '=') arg++; for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) { - if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len)) + if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) && + !strncmp(arg, cmt_fmts[i].n, strlen(arg))) return cmt_fmts[i].v; }