]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/clone-coderepo.t
imap: quiet Parse::RecDescent errors on bad search queries
[public-inbox.git] / t / clone-coderepo.t
index 66eaa03076d996011c8a85260f21bcaf2406b292..1f33a6d723df66fe571ed2920c8520f2c94715a0 100644 (file)
@@ -6,7 +6,7 @@ use PublicInbox::TestCommon;
 use PublicInbox::Import;
 use File::Temp;
 use File::Path qw(remove_tree);
-use Digest::SHA qw(sha1_hex);
+use PublicInbox::SHA qw(sha1_hex);
 require_mods(qw(json Plack::Builder HTTP::Date HTTP::Status));
 require_git '1.8.5';
 require_ok 'PublicInbox::LeiMirror';
@@ -86,7 +86,7 @@ EOM
 }
 
 my $cmd = [qw(-clone --inbox-config=never --manifest= --project-list=
-       --objstore= -p -q), $url, "$tmpdir/dst"];
+       --objstore= -p -q), $url, "$tmpdir/dst", '--exit-code'];
 ok(run_script($cmd), 'clone');
 is(xqx([qw(git config gitweb.owner)], { GIT_DIR => "$tmpdir/dst/a.git" }),
        "Alice\n", 'a.git gitweb.owner set');
@@ -149,6 +149,10 @@ my $test_puh = sub {
        unlink($log) or xbail "unlink: $!";
        ok(run_script($x, $env), "no-op clone @clone_arg w/ post-update-hook");
        ok(!-e $log, "hooks not run on no-op @clone_arg");
+
+       push @$x, '--exit-code';
+       ok(!run_script($x, $env), 'no-op clone w/ --exit-code fails');
+       is($? >> 8, 127, '--exit-code gave 127');
 };
 $test_puh->();
 ok(!-e "$tmpdir/dst/objstore", 'no objstore, yet');