about summary refs log tree commit homepage
path: root/t/v2mirror.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-24 10:56:45 +0000
committerEric Wong <e@80x24.org>2021-09-24 23:22:08 +0000
commit77b3dac08f58503e374e98c29b9e0ee7c866c0e5 (patch)
tree23b91c308d6a6293007ee3f807f8696700750fd4 /t/v2mirror.t
parent718d054be8b2cc23635b42e8ce880424492d3a84 (diff)
downloadpublic-inbox-77b3dac08f58503e374e98c29b9e0ee7c866c0e5.tar.gz
There may still be pre-manifest.js.gz versions of
PublicInbox::WWW running and serving v2 inboxes.

While -clone and "add-external --mirror" were working, -fetch
was failing due to 301 redirect to $INBOX_URL/manifest.js.gz/
and not the expected 404.  Update the code to deal with a JSON
decode error (from the 301) and ensure v2 epochs detection is
correct (and not using a shadowed variable).
Diffstat (limited to 't/v2mirror.t')
-rw-r--r--t/v2mirror.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/v2mirror.t b/t/v2mirror.t
index fa4a717d..a625646d 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -376,6 +376,14 @@ EOM
         my @g_last = grep { -w $_ } glob("$dst/git/*.git");
         is_deeply(\@g_last, [ $g_all[-1] ], 'partial clone of ~0 worked');
 
+        chmod(0755, $g_all[0]) or xbail "chmod $!";
+        my @before = glob("$g_all[0]/objects/*/*");
+        run_script([qw(-fetch -v)], undef, { -C => $dst, 2 => \($err = '') });
+        is($?, 0, 'scraping fetch on old PublicInbox::WWW') or diag $err;
+        my @after = glob("$g_all[0]/objects/*/*");
+        ok(scalar(@before) < scalar(@after),
+                'fetched 0.git after enabling write-bit');
+
         $td->join('TERM');
 }