]> Sergey Matveev's repositories - public-inbox.git/commitdiff
import: fallback to email if '<>' exists in author name
authorEric Wong <e@80x24.org>
Thu, 12 May 2016 09:06:56 +0000 (09:06 +0000)
committerEric Wong <e@80x24.org>
Thu, 12 May 2016 09:06:56 +0000 (09:06 +0000)
git doesn't handle '<' and '>' characters in the author
name at all regardless of quoting, not just matched pairs.
So fall back to using the email as the author name since
the commit info isn't critical, anyways (shallow clones
are fine).

lib/PublicInbox/Import.pm

index 1f52a0cc80f9eddd40a8e16f7b44496a4085b005..1db2a0b858701051f0c03e2e01b19e05b1518da5 100644 (file)
@@ -152,7 +152,7 @@ sub add {
        #  "'A U Thor <u@example.com>' via foo" <foo@example.com>
        # ref:
        # <CAD0k6qSUYANxbjjbE4jTW4EeVwOYgBD=bXkSu=akiYC_CB7Ffw@mail.gmail.com>
-       $name =~ s/<([^>]+)>/($1)/g;
+       $name =~ tr/<>// and $name = $email;
 
        my ($r, $w) = $self->gfi_start;
        my $tip = $self->{tip};