summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-02-10 22:08:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-02-10 22:08:12 (GMT)
commit3d8bc74127bbb583bc437214a1d6c9afcf77646c (patch)
tree6d1788c66ea9e038252cf6641b5c580c641dcb88 /builtin/commit.c
parentfd6abd0c65b38897da64ef883ed1934d2b2b1a3a (diff)
parent2c733fb24c10a9d7aacc51f956bf9b7881980870 (diff)
downloadgit-3d8bc74127bbb583bc437214a1d6c9afcf77646c.zip
git-3d8bc74127bbb583bc437214a1d6c9afcf77646c.tar.gz
git-3d8bc74127bbb583bc437214a1d6c9afcf77646c.tar.bz2
Merge branch 'jc/parse-date-raw'
* jc/parse-date-raw: parse_date(): '@' prefix forces git-timestamp parse_date(): allow ancient git-timestamp
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 470b4a4..eae5a29 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) {