about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiStore.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-17 08:13:16 +0000
committerEric Wong <e@80x24.org>2020-12-19 09:32:08 +0000
commit2b3e0878f79efcfce1f572f5f57eb51dc3a0b370 (patch)
treeca623da43dacac117ff3163fa6afe7ca50abd5eb /lib/PublicInbox/LeiStore.pm
parent50ce71e698e038e643d81d9f5948e002384b5898 (diff)
downloadpublic-inbox-2b3e0878f79efcfce1f572f5f57eb51dc3a0b370.tar.gz
It's pretty meaningless, since probably nobody notices committer
info we extract author info from individual emails, anyways.
Diffstat (limited to 'lib/PublicInbox/LeiStore.pm')
-rw-r--r--lib/PublicInbox/LeiStore.pm13
1 files changed, 9 insertions, 4 deletions
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;