From 2b3e0878f79efcfce1f572f5f57eb51dc3a0b370 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 17 Dec 2020 08:13:16 +0000 Subject: 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. --- lib/PublicInbox/LeiStore.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/LeiStore.pm') 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; -- cgit v1.2.3-24-ge0c7