summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-02-13 11:42:15 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-02-13 11:42:15 -0800
commit87cb3b82a42613dc3ffd1eddf95f8c306a045ad1 (patch)
tree056bc067a0f6de58609373179d1795df07821627 /builtin
parentMerge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint (diff)
parentparse_date(): '@' prefix forces git-timestamp (diff)
downloadtgif-87cb3b82a42613dc3ffd1eddf95f8c306a045ad1.tar.xz
Merge branch 'jc/parse-date-raw' into maint
* jc/parse-date-raw: parse_date(): '@' prefix forces git-timestamp parse_date(): allow ancient git-timestamp
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index eba1377eb3..2deccb5444 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -543,6 +543,7 @@ static void determine_author_info(struct strbuf *author_ident)
if (author_message) {
const char *a, *lb, *rb, *eol;
+ size_t len;
a = strstr(author_message_buffer, "\nauthor ");
if (!a)
@@ -563,6 +564,11 @@ static void determine_author_info(struct strbuf *author_ident)
(a + strlen("\nauthor "))));
email = xmemdupz(lb + strlen("<"), rb - (lb + strlen("<")));
date = xmemdupz(rb + strlen("> "), eol - (rb + strlen("> ")));
+ len = eol - (rb + strlen("> "));
+ date = xmalloc(len + 2);
+ *date = '@';
+ memcpy(date + 1, rb + strlen("> "), len);
+ date[len + 1] = '\0';
}
if (force_author) {