@matheusbsbs / matheus-bagliano / commits / b6936205e7
Fork 0

Disallow invalid --pretty= abbreviations

--pretty=o is a valid abbreviation, --pretty=omfg is not Noticed by: Nicolas Vilz Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>

Eric Wong committed Feb 2, 2007 at 05:10 UTC b6936205e73c058784288d21d1937e5bba26b91b
1 file changed +2 -1
commit.c
+2 -1
@@ -47,7 +47,8 @@ enum cmit_fmt get_commit_format(const char *arg)
47 if (*arg == '=')
48 arg++;
49 for (i = 0; i < ARRAY_SIZE(cmt_fmts); i++) {
50 - if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len))
50 + if (!strncmp(arg, cmt_fmts[i].n, cmt_fmts[i].cmp_len) &&
51 + !strncmp(arg, cmt_fmts[i].n, strlen(arg)))
52 return cmt_fmts[i].v;
53 }
54