about summary refs log tree commit homepage
path: root/t/www_listing.t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-19 23:19:34 +0000
committerEric Wong <e@yhbt.net>2020-04-20 20:18:16 +0000
commitd55abcc42bde846d9047491125dd2b32645dafd8 (patch)
treea7dd9274b4790732aaa401757490919d3e8296b7 /t/www_listing.t
parentb3a04ae18a42ed960c89cc81c209633da6976380 (diff)
downloadpublic-inbox-d55abcc42bde846d9047491125dd2b32645dafd8.tar.gz
Allowing ->init_bare to be used as a method saves some
keystrokes, and we can save a little bit of time on systems with
our vfork(2)-enabled spawn().

This also sets us up for future improvements where we can
avoid spawning a process at all.
Diffstat (limited to 't/www_listing.t')
-rw-r--r--t/www_listing.t5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/www_listing.t b/t/www_listing.t
index 9230329c..c132edbc 100644
--- a/t/www_listing.t
+++ b/t/www_listing.t
@@ -6,6 +6,7 @@ use warnings;
 use Test::More;
 use PublicInbox::Spawn qw(which);
 use PublicInbox::TestCommon;
+use PublicInbox::Import;
 require_mods(qw(URI::Escape Plack::Builder Digest::SHA
                 IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny));
 require PublicInbox::WwwListing;
@@ -18,7 +19,7 @@ use_ok 'PublicInbox::Git';
 
 my ($tmpdir, $for_destroy) = tmpdir();
 my $bare = PublicInbox::Git->new("$tmpdir/bare.git");
-is(system(qw(git init -q --bare), $bare->{git_dir}), 0, 'git init --bare');
+PublicInbox::Import::init_bare($bare->{git_dir});
 is(PublicInbox::WwwListing::fingerprint($bare), undef,
         'empty repo has no fingerprint');
 {
@@ -77,7 +78,7 @@ SKIP: {
         my @clone = qw(git clone -q -s --bare);
         is(system(@clone, $bare->{git_dir}, $alt), 0, 'clone shared repo');
 
-        system(qw(git init --bare -q), "$v2/all.git") == 0 or die;
+        PublicInbox::Import::init_bare("$v2/all.git");
         for my $i (0..2) {
                 is(system(@clone, $alt, "$v2/git/$i.git"), 0, "clone epoch $i");
         }