Seeing the same warning over and over again gets annoying.
$self->git->cleanup;
my $mode = 0644;
my $ALL = $self->git->{git_dir}; # topdir/ALL.git
$self->git->cleanup;
my $mode = 0644;
my $ALL = $self->git->{git_dir}; # topdir/ALL.git
- my ($has_new, $alt, $seen);
+ my ($has_new, $alt, $seen, $prune, $prune_nr);
if ($opt->{-private}) { # LeiStore
my $local = "$self->{topdir}/local"; # lei/store
$self->{mg} //= PublicInbox::MultiGit->new($self->{topdir},
if ($opt->{-private}) { # LeiStore
my $local = "$self->{topdir}/local"; # lei/store
$self->{mg} //= PublicInbox::MultiGit->new($self->{topdir},
} else { # extindex has no epochs
$self->{mg} //= PublicInbox::MultiGit->new($self->{topdir},
'ALL.git');
} else { # extindex has no epochs
$self->{mg} //= PublicInbox::MultiGit->new($self->{topdir},
'ALL.git');
- ($alt, $seen) = $self->{mg}->read_alternates(\$mode,
- $opt->{-idx_gc});
+ $prune = $opt->{-idx_gc} ? \$prune_nr : undef;
+ ($alt, $seen) = $self->{mg}->read_alternates(\$mode, $prune);
PublicInbox::Import::init_bare($ALL);
}
PublicInbox::Import::init_bare($ALL);
}
- ($has_new || $new ne '') and
+ ($has_new || $prune_nr || $new ne '') and
$self->{mg}->write_alternates($mode, $alt, $new);
$git_midx and $self->with_umask(sub {
my @cmd = ('multi-pack-index');
$self->{mg}->write_alternates($mode, $alt, $new);
$git_midx and $self->with_umask(sub {
my @cmd = ('multi-pack-index');
$alt{$rel} = $score;
} else {
warn "W: stat($dir) failed: $! ($f)";
$alt{$rel} = $score;
} else {
warn "W: stat($dir) failed: $! ($f)";
- $alt{$rel} = $score unless $prune;
+ if ($prune) {
+ ++$$prune;
+ } else {
+ $alt{$rel} = $score;
+ }
}
}
} elsif (!$!{ENOENT}) {
}
}
} elsif (!$!{ENOENT}) {