about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-03-18 12:02:12 +0000
committerEric Wong <e@80x24.org>2023-03-18 18:52:53 +0000
commitb1ee9716d67f10ae19266acec1e8eff8275d7e7c (patch)
treea2c170f7faf8b2616005345d6764da36cfc7e87c
parent6fd0acf381dbb21a228b1382a5f6e89a92870eae (diff)
downloadpublic-inbox-b1ee9716d67f10ae19266acec1e8eff8275d7e7c.tar.gz
--project-list= is no longer required to show stale
repositories.
-rw-r--r--lib/PublicInbox/LeiMirror.pm14
1 files 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;
 }