]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/InboxWritable.pm
support multiple CODE_URLs
[public-inbox.git] / lib / PublicInbox / InboxWritable.pm
index 4980904541af7f245c09787d6bea59f8082d64c6..c0e88f3d52ad1e21b6ec5a470ceff423af0fca5b 100644 (file)
@@ -287,6 +287,8 @@ sub warn_ignore {
        # PublicInbox::MsgTime
        || $s =~ /^bogus TZ offset: .+?, ignoring and assuming \+0000/
        || $s =~ /^bad Date: .+? in /
+       # Encode::Unicode::UTF7
+       || $s =~ /^Bad UTF7 data escape at /
 }
 
 # this expects to be RHS in this assignment: "local $SIG{__WARN__} = ..."
@@ -298,25 +300,11 @@ sub warn_ignore_cb {
        }
 }
 
-# v2+ only
-sub git_dir_n { "$_[0]->{inboxdir}/git/$_[1].git" }
-
-# v2+ only
+# v2+ only, XXX: maybe we can just rely on ->max_git_epoch and remove
 sub git_dir_latest {
        my ($self, $max) = @_;
-       $$max = -1;
-       my $pfx = "$self->{inboxdir}/git";
-       return unless -d $pfx;
-       my $latest;
-       opendir my $dh, $pfx or die "opendir $pfx: $!\n";
-       while (defined(my $git_dir = readdir($dh))) {
-               $git_dir =~ m!\A([0-9]+)\.git\z! or next;
-               if ($1 > $$max) {
-                       $$max = $1;
-                       $latest = "$pfx/$git_dir";
-               }
-       }
-       $latest;
+       defined($$max = $self->max_git_epoch) ?
+               "$self->{inboxdir}/git/$$max.git" : undef;
 }
 
 1;