From: Eric Wong Date: Thu, 17 Dec 2020 08:13:16 +0000 (+0000) Subject: lei_store: relax GIT_COMMITTER_IDENT check X-Git-Tag: v1.7.0~1471^2~12 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=2b3e0878f79efcfce1f572f5f57eb51dc3a0b370;p=public-inbox.git lei_store: relax GIT_COMMITTER_IDENT check It's pretty meaningless, since probably nobody notices committer info we extract author info from individual emails, anyways. --- diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index d3667d29..c95df785 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -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;