X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fclone-coderepo.t;h=1f33a6d723df66fe571ed2920c8520f2c94715a0;hb=dd029354eb69c4faf3160640828fd8e7b9403855;hp=66eaa03076d996011c8a85260f21bcaf2406b292;hpb=68e182a29404407680bee482f99ee24dd9c3c7cb;p=public-inbox.git diff --git a/t/clone-coderepo.t b/t/clone-coderepo.t index 66eaa030..1f33a6d7 100644 --- a/t/clone-coderepo.t +++ b/t/clone-coderepo.t @@ -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');