diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-02-10 14:08:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-10 14:08:12 -0800 |
commit | 3d8bc74127bbb583bc437214a1d6c9afcf77646c (patch) | |
tree | 6d1788c66ea9e038252cf6641b5c580c641dcb88 /builtin | |
parent | fd6abd0c65b38897da64ef883ed1934d2b2b1a3a (diff) | |
parent | 2c733fb24c10a9d7aacc51f956bf9b7881980870 (diff) | |
download | git-3d8bc74127bbb583bc437214a1d6c9afcf77646c.tar.gz git-3d8bc74127bbb583bc437214a1d6c9afcf77646c.tar.xz |
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')
-rw-r--r-- | builtin/commit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 470b4a4e8..eae5a29ae 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) { |