diff options
author | Jeff King <peff@peff.net> | 2014-08-27 03:57:28 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-08-29 10:33:28 -0700 |
commit | f0f9662ae9d1c7f58a95397d1c6d5f31760b14be (patch) | |
tree | ed31a3d9d8f6a7833b81f0e0cd643a3a810fea20 /date.c | |
parent | date: use strbufs in date-formatting functions (diff) | |
download | tgif-f0f9662ae9d1c7f58a95397d1c6d5f31760b14be.tar.xz |
determine_author_info(): reuse parsing functions
Rather than parsing the header manually to find the "author"
field, and then parsing its sub-parts, let's use
find_commit_header and split_ident_line. This is shorter and
easier to read, and should do a more careful parsing job.
For example, the current parser could find the end-of-email
right-bracket across a newline (for a malformed commit), and
calculate a bogus gigantic length for the date (by using
"eol - rb").
As a bonus, this also plugs a memory leak when we pull the
date field from an existing commit (we still leak the name
and email buffers, which will be fixed in a later commit).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'date.c')
0 files changed, 0 insertions, 0 deletions