aboutsummaryrefslogtreecommitdiff
path: root/ident.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-07 14:34:51 -0800
committerJunio C Hamano <gitster@pobox.com>2013-11-07 14:34:51 -0800
commit0ceb7537c11f60d15786fa12b7d9602c68ee1b29 (patch)
treed081967fab305b6356491d40325314bc12a26ece /ident.c
parent0faff47d7b5cab05b51121e335f7ba1899482728 (diff)
parent03818a4a94cbe8154eae433892e92d58d215dade (diff)
downloadgit-0ceb7537c11f60d15786fa12b7d9602c68ee1b29.tar.gz
git-0ceb7537c11f60d15786fa12b7d9602c68ee1b29.tar.xz
Merge branch 'jk/split-broken-ident' into maint
The fall-back parsing of commit objects with broken author or committer lines were less robust than ideal in picking up the timestamps. * jk/split-broken-ident: split_ident: parse timestamp from end of line
Diffstat (limited to 'ident.c')
-rw-r--r--ident.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/ident.c b/ident.c
index b29f81f83..1d9b6e770 100644
--- a/ident.c
+++ b/ident.c
@@ -233,7 +233,21 @@ int split_ident_line(struct ident_split *split, const char *line, int len)
if (!split->mail_end)
return status;
- for (cp = split->mail_end + 1; cp < line + len && isspace(*cp); cp++)
+ /*
+ * Look from the end-of-line to find the trailing ">" of the mail
+ * address, even though we should already know it as split->mail_end.
+ * This can help in cases of broken idents with an extra ">" somewhere
+ * in the email address. Note that we are assuming the timestamp will
+ * never have a ">" in it.
+ *
+ * Note that we will always find some ">" before going off the front of
+ * the string, because will always hit the split->mail_end closing
+ * bracket.
+ */
+ for (cp = line + len - 1; *cp != '>'; cp--)
+ ;
+
+ for (cp = cp + 1; cp < line + len && isspace(*cp); cp++)
;
if (line + len <= cp)
goto person_only;