From: Eric Wong Date: Thu, 27 Apr 2023 22:32:21 +0000 (+0000) Subject: t/watch_maildir: eliminate extra LF from cat-file requests X-Git-Tag: v2.0.0~1164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc6ff982395f13efe56d5d4dd290359ee389b71b;p=thirdparty%2Fpublic-inbox.git t/watch_maildir: eliminate extra LF from cat-file requests This allows us to eliminate the workaround of respawning `git cat-file', too :x --- diff --git a/t/watch_maildir.t b/t/watch_maildir.t index 04a1c959e..6836a3d9c 100644 --- a/t/watch_maildir.t +++ b/t/watch_maildir.t @@ -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');