]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inboxwritable: drop git_dir_n sub
authorEric Wong <e@80x24.org>
Wed, 16 Dec 2020 23:19:05 +0000 (23:19 +0000)
committerEric Wong <e@80x24.org>
Thu, 17 Dec 2020 19:41:15 +0000 (19:41 +0000)
There's only one caller, unlikely to be any more, and
should be harmless to open code.

lib/PublicInbox/InboxWritable.pm
lib/PublicInbox/V2Writable.pm

index 48d2267f3bfacb2cdd29049aec1d680103169850..c0e88f3d52ad1e21b6ec5a470ceff423af0fca5b 100644 (file)
@@ -300,9 +300,6 @@ sub warn_ignore_cb {
        }
 }
 
-# v2+ only
-sub git_dir_n { "$_[0]->{inboxdir}/git/$_[1].git" }
-
 # v2+ only, XXX: maybe we can just rely on ->max_git_epoch and remove
 sub git_dir_latest {
        my ($self, $max) = @_;
index 7b8b5abf7a87140c67a3ffcbfeea893dbee610af..3e3b275f995f44e6a1403bdc382e71cbae213451 100644 (file)
@@ -1091,8 +1091,9 @@ sub sync_prepare ($$) {
        if ($sync->{max_size} = $sync->{-opt}->{max_size}) {
                $sync->{index_oid} = $self->can('index_oid');
        }
+       my $git_pfx = "$sync->{ibx}->{inboxdir}/git";
        for (my $i = $sync->{epoch_max}; $i >= 0; $i--) {
-               my $git_dir = $sync->{ibx}->git_dir_n($i);
+               my $git_dir = "$git_pfx/$i.git";
                -d $git_dir or next; # missing epochs are fine
                my $git = PublicInbox::Git->new($git_dir);
                my $unit = { git => $git, epoch => $i };