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