]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/watch_maildir: eliminate extra LF from cat-file requests
authorEric Wong <e@80x24.org>
Thu, 27 Apr 2023 22:32:21 +0000 (22:32 +0000)
committerEric Wong <e@80x24.org>
Fri, 28 Apr 2023 00:19:51 +0000 (00:19 +0000)
This allows us to eliminate the workaround of respawning
`git cat-file', too :x

t/watch_maildir.t

index 04a1c959eb60d46606617770926dfcb6e752a71a..6836a3d9c11239c8ff452ba96ac92feb7020c934 100644 (file)
@@ -97,6 +97,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
        PublicInbox::Watch->new($cfg)->scan('full');
        @list = $git->qx('ls-tree', '-r', '--name-only', $default_branch);
        is(scalar @list, 1, 'tree has one file');
+       chomp(@list);
        my $mref = $git->cat_file('HEAD:'.$list[0]);
        like($$mref, qr/something\n\z/s, 'message scrubbed on import');
 
@@ -137,10 +138,7 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
        PublicInbox::Watch->new($cfg)->scan('full');
        @list = $git->qx('ls-tree', '-r', '--name-only', $default_branch);
        is(scalar @list, 1, 'tree has one file after spamc checked');
-
-       # XXX: workaround some weird caching/memoization in cat-file,
-       # shouldn't be an issue in real-world use, though...
-       $git = PublicInbox::Git->new($git_dir);
+       chomp(@list);
 
        my $mref = $git->cat_file($default_branch.':'.$list[0]);
        like($$mref, qr/something\n\z/s, 'message scrubbed on import');