Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2007-02-02 16:10:25 +0300
committerJunio C Hamano <junkio@cox.net>2007-02-03 08:18:59 +0300
commitb6936205e73c058784288d21d1937e5bba26b91b (patch)
tree5e6080c549d2a291c6c6cc4c4a7ae6abe3593f6a /commit.c
parentaacd404e775ad73188ae9157041d7cc530d5625c (diff)
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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index 9b2b842e7d..3e8c87294b 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;
}