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-0012-no-hook-error--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-0012-no-hook-error--porcelain.sh` 62 lines ยท 2486 bytes Raw Blame History 1 # Refs of upstream : main(A) 2 # Refs of workbench: main(A) tags/v123 3 # git push : next(A) refs/for/main/topic(A) 4 test_expect_success "proc-receive: no hook, fail to push special ref ($PROTOCOL/porcelain)" ' 5 test_must_fail git -C workbench push --porcelain origin \ 6 HEAD:next \ 7 HEAD:refs/for/main/topic \ 8 >out-$test_count 2>&1 && 9 make_user_friendly_and_stable_output actual && 10 format_and_save_expect <<-EOF && 11 > remote: # pre-receive hook Z 12 > remote: pre-receive< refs/heads/next Z 13 > remote: pre-receive< refs/for/main/topic Z 14 > remote: error: cannot find hook "proc-receive" Z 15 > remote: # post-receive hook Z 16 > remote: post-receive< refs/heads/next Z 17 > To 18 > * HEAD:refs/heads/next [new branch] 19 > ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 20 Done 21 EOF 22 test_cmp expect actual && 23 24 test_cmp_refs -C "$upstream" <<-EOF 25 refs/heads/main 26 refs/heads/next 27 EOF 28 ' 29 30 # Refs of upstream : main(A) next(A) 31 # Refs of workbench: main(A) tags/v123 32 test_expect_success "cleanup ($PROTOCOL/porcelain)" ' 33 git -C "$upstream" update-ref -d refs/heads/next 34 ' 35 36 # Refs of upstream : main(A) 37 # Refs of workbench: main(A) tags/v123 38 # git push --atomic: (B) next(A) refs/for/main/topic(A) 39 test_expect_success "proc-receive: no hook, all failed for atomic push ($PROTOCOL/porcelain)" ' 40 test_must_fail git -C workbench push --porcelain --atomic origin \ 41 $B:main \ 42 HEAD:next \ 43 HEAD:refs/for/main/topic >out-$test_count 2>&1 && 44 make_user_friendly_and_stable_output actual && 45 format_and_save_expect <<-EOF && 46 > remote: # pre-receive hook Z 47 > remote: pre-receive< refs/heads/main Z 48 > remote: pre-receive< refs/heads/next Z 49 > remote: pre-receive< refs/for/main/topic Z 50 > remote: error: cannot find hook "proc-receive" Z 51 > To 52 > ! :refs/heads/main [remote rejected] (fail to run proc-receive hook) 53 > ! HEAD:refs/heads/next [remote rejected] (fail to run proc-receive hook) 54 > ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 55 > Done 56 EOF 57 test_cmp expect actual && 58 59 test_cmp_refs -C "$upstream" <<-EOF 60 refs/heads/main 61 EOF 62 '