diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-10-28 10:43:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-10-28 10:43:32 -0700 |
commit | 2125261b631c429175821299ece33449dbd3ab96 (patch) | |
tree | a0c023a96dc3925dfe666dc337727c63347617cd /ident.c | |
parent | 93542d90c005ee614ce6ad4dde16b89764cdea67 (diff) | |
parent | 03818a4a94cbe8154eae433892e92d58d215dade (diff) | |
download | git-2125261b631c429175821299ece33449dbd3ab96.tar.gz |
Merge branch 'jk/split-broken-ident'
Make the fall-back parsing of commit objects with broken author or
committer lines more robust to pick up the timestamps.
* jk/split-broken-ident:
split_ident: parse timestamp from end of line
Diffstat (limited to 'ident.c')
-rw-r--r-- | ident.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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; |