]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_store: relax GIT_COMMITTER_IDENT check
authorEric Wong <e@80x24.org>
Thu, 17 Dec 2020 08:13:16 +0000 (08:13 +0000)
committerEric Wong <e@80x24.org>
Sat, 19 Dec 2020 09:32:08 +0000 (09:32 +0000)
It's pretty meaningless, since probably nobody notices committer
info we extract author info from individual emails, anyways.

lib/PublicInbox/LeiStore.pm

index d3667d29ba5d4eb42bd42248f94baa46707a90aa..c95df785a0de18bce1c241c369af3555f93825c8 100644 (file)
@@ -52,6 +52,14 @@ sub git_epoch_max  {
        }
 }
 
+sub git_ident ($) {
+       my ($git) = @_;
+       chomp(my $i = $git->qx(qw(var GIT_COMMITTER_IDENT)));
+       warn "$git->{git_dir} GIT_COMMITTER_IDENT failed\n" if $?;
+       $i =~ /\A(.+) <([^>]+)> [0-9]+ [-\+]?[0-9]+$/ ? ($1, $2) :
+               ('lei user', 'x@example.com')
+}
+
 sub importer {
        my ($self) = @_;
        my $max;
@@ -79,10 +87,7 @@ sub importer {
                        $max++;
                        next;
                }
-               chomp(my $i = $git->qx(qw(var GIT_COMMITTER_IDENT)));
-               die "$git->{git_dir} GIT_COMMITTER_IDENT failed\n" if $?;
-               my ($n, $e) = ($i =~ /\A(.+) <([^>]+)> [0-9]+ [-\+]?[0-9]+$/g)
-                       or die "could not extract name/email from `$i'\n";
+               my ($n, $e) = git_ident($git);
                $self->{im} = $im = PublicInbox::Import->new($git, $n, $e);
                $im->{bytes_added} = int($packed_bytes / $self->packing_factor);
                $im->{lock_path} = undef;