- my $obj = $ctx->{-inbox};
- my $desc = ascii_html($obj->description);
-
- my (%seen, @urls);
- my $http = $obj->base_url($ctx->{env});
- chop $http; # no trailing slash
- my $part = $obj->max_git_part;
- if (defined($part)) { # v2
- # most recent partition first:
- for (; $part >= 0; $part--) {
- my $url = "$http/$part";
+ my $ibx = $ctx->{-inbox};
+ my $desc = ascii_html($ibx->description);
+
+ my @urls;
+ my $http = $self->{base_url};
+ my $max = $ibx->max_git_epoch;
+ my $dir = (split(m!/!, $http))[-1];
+ my %seen = ($http => 1);
+ if (defined($max)) { # v2
+ for my $i (0..$max) {
+ # old parts my be deleted:
+ -d "$ibx->{inboxdir}/git/$i.git" or next;
+ my $url = "$http/$i";