about summary refs log tree commit homepage
path: root/t/git.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/git.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/git.t')
-rw-r--r--t/git.t5
1 files changed, 3 insertions, 2 deletions
diff --git a/t/git.t b/t/git.t
index 8224969d..0936ac5e 100644
--- a/t/git.t
+++ b/t/git.t
@@ -6,11 +6,12 @@ use Test::More;
 use PublicInbox::TestCommon;
 my ($dir, $for_destroy) = tmpdir();
 use PublicInbox::Spawn qw(popen_rd);
+use PublicInbox::Import;
 
 use_ok 'PublicInbox::Git';
 
 {
-        is(system(qw(git init -q --bare), $dir), 0, 'created git directory');
+        PublicInbox::Import::init_bare($dir);
         my $fi_data = './t/git.fast-import-data';
         ok(-r $fi_data, "fast-import data readable (or run test at top level)");
         local $ENV{GIT_DIR} = $dir;
@@ -90,7 +91,7 @@ if (1) {
 if ('alternates reloaded') {
         my ($alt, $alt_obj) = tmpdir();
         my @cmd = ('git', "--git-dir=$alt", qw(hash-object -w --stdin));
-        is(system(qw(git init -q --bare), $alt), 0, 'create alt directory');
+        PublicInbox::Import::init_bare($alt);
         open my $fh, '<', "$alt/config" or die "open failed: $!\n";
         my $rd = popen_rd(\@cmd, {}, { 0 => $fh } );
         close $fh or die "close failed: $!";