summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-07-29 17:54:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-30 19:30:06 (GMT)
commitc75e7ad28a34081ca6e7e53c0551fa6c99b208b0 (patch)
tree5ad17ad53bdc10e5eaeecf5c75fddddab39dbab0 /pretty.c
parentae18165fbbf5e15ab2371d09f79cd12ee403c51e (diff)
downloadgit-c75e7ad28a34081ca6e7e53c0551fa6c99b208b0.zip
git-c75e7ad28a34081ca6e7e53c0551fa6c99b208b0.tar.gz
git-c75e7ad28a34081ca6e7e53c0551fa6c99b208b0.tar.bz2
pretty: treat "--format=" as an empty userformat
Until now, we treated "--pretty=" or "--format=" as "give me the default format". This was not planned nor documented, but only what happened to work due to our parsing of "--pretty" (which should give the default format). Let's instead let these be an actual empty userformat. Otherwise one must write out the annoyingly long "--pretty=tformat:" to get the same behavior. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pretty.c b/pretty.c
index 3a1da6f..f97a762 100644
--- a/pretty.c
+++ b/pretty.c
@@ -146,7 +146,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)
struct cmt_fmt_map *commit_format;
rev->use_terminator = 0;
- if (!arg || !*arg) {
+ if (!arg) {
rev->commit_format = CMIT_FMT_DEFAULT;
return;
}
@@ -155,7 +155,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)
return;
}
- if (strchr(arg, '%')) {
+ if (!*arg || strchr(arg, '%')) {
save_user_format(rev, arg, 1);
return;
}