Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t5411/test-0003-pre-receive-declined--porcelain.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t5411 / test-0003-pre-receive-declined--porcelain.sh` 32 lines ยท 1043 bytes Raw Blame History 1 test_expect_success "setup pre-receive hook ($PROTOCOL/porcelain)" ' 2 mv "$upstream/hooks/pre-receive" "$upstream/hooks/pre-receive.ok" && 3 test_hook -C "$upstream" --clobber pre-receive <<-\EOF 4 exit 1 5 EOF 6 ' 7 8 # Refs of upstream : main(A) 9 # Refs of workbench: main(A) tags/v123 10 # git-push : main(B) next(A) 11 test_expect_success "git-push is declined ($PROTOCOL/porcelain)" ' 12 test_must_fail git -C workbench push --porcelain origin \ 13 $B:refs/heads/main \ 14 HEAD:refs/heads/next \ 15 >out-$test_count 2>&1 && 16 make_user_friendly_and_stable_output actual && 17 format_and_save_expect <<-EOF && 18 > To 19 > ! :refs/heads/main [remote rejected] (pre-receive hook declined) 20 > ! HEAD:refs/heads/next [remote rejected] (pre-receive hook declined) 21 Done 22 EOF 23 test_cmp expect actual && 24 25 test_cmp_refs -C "$upstream" <<-EOF 26 refs/heads/main 27 EOF 28 ' 29 30 test_expect_success "cleanup ($PROTOCOL/porcelain)" ' 31 mv "$upstream/hooks/pre-receive.ok" "$upstream/hooks/pre-receive" 32 '