--project-list= is no longer required to show stale
repositories.
---
 lib/PublicInbox/LeiMirror.pm | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index c8d28eba..8b7e48ab 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -1089,8 +1089,8 @@ sub dump_manifest ($$) {
 
 sub dump_project_list ($$) {
        my ($self, $m) = @_;
-       my $f = $self->{'-project-list'} // return;
-       my $old = PublicInbox::Git::try_cat($f);
+       my $f = $self->{'-project-list'};
+       my $old = defined($f) ? PublicInbox::Git::try_cat($f) : '';
        my %new;
 
        open my $dh, '<', '.' or die "open(.): $!";
@@ -1108,13 +1108,15 @@ sub dump_project_list ($$) {
 The following local repositories are ignored/gone from $self->{src}:
 EOM
        warn "\t", $_, "\n" for @remote;
-       warn <<EOM if @local;
+       if (defined($f) && @local) {
+               warn <<EOM;
 The following repos in $f no longer exist on the filesystem:
 EOM
-       warn "\t", $_, "\n" for @local;
-
-       my (undef, $dn, $bn) = File::Spec->splitpath($f);
+               warn "\t", $_, "\n" for @local;
+       }
        $self->{chg}->{nr_chg} += scalar(@remote) + scalar(@local);
+       $f // return;
+       my (undef, $dn, $bn) = File::Spec->splitpath($f);
        my $new = join("\n", @list, '');
        atomic_write($dn, $bn, $new) if $new ne $old;
 }

Reply via email to