diff options
author | Eric Wong <normalperson@yhbt.net> | 2007-02-02 05:10:25 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-02-02 21:18:59 -0800 |
commit | b6936205e73c058784288d21d1937e5bba26b91b (patch) | |
tree | 5e6080c549d2a291c6c6cc4c4a7ae6abe3593f6a /commit.c | |
parent | aacd404e775ad73188ae9157041d7cc530d5625c (diff) | |
download | git-b6936205e73c058784288d21d1937e5bba26b91b.tar.gz |
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>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |