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-0022-report-unexpect-ref.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-0022-report-unexpect-ref.sh` 43 lines ยท 1658 bytes Raw Blame History 1 test_expect_success "setup proc-receive hook (unexpected ref, $PROTOCOL)" ' 2 test_hook -C "$upstream" --clobber proc-receive <<-\EOF 3 printf >&2 "# proc-receive hook\n" 4 test-tool proc-receive -v \ 5 -r "ok refs/heads/main" 6 EOF 7 ' 8 9 # Refs of upstream : main(A) 10 # Refs of workbench: main(A) tags/v123 11 # git push : (B) refs/for/main/topic 12 test_expect_success "proc-receive: report unexpected ref ($PROTOCOL)" ' 13 test_must_fail git -C workbench push origin \ 14 $B:refs/heads/main \ 15 HEAD:refs/for/main/topic \ 16 >out-$test_count 2>&1 && 17 make_user_friendly_and_stable_output actual && 18 format_and_save_expect <<-EOF && 19 > remote: # pre-receive hook Z 20 > remote: pre-receive< refs/heads/main Z 21 > remote: pre-receive< refs/for/main/topic Z 22 > remote: # proc-receive hook Z 23 > remote: proc-receive< refs/for/main/topic Z 24 > remote: proc-receive> ok refs/heads/main Z 25 > remote: error: proc-receive reported status on unexpected ref: refs/heads/main Z 26 > remote: # post-receive hook Z 27 > remote: post-receive< refs/heads/main Z 28 > To 29 > .. -> main 30 > ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 31 EOF 32 test_cmp expect actual && 33 34 test_cmp_refs -C "$upstream" <<-EOF 35 refs/heads/main 36 EOF 37 ' 38 39 # Refs of upstream : main(B) 40 # Refs of workbench: main(A) tags/v123 41 test_expect_success "cleanup ($PROTOCOL)" ' 42 git -C "$upstream" update-ref refs/heads/main $A 43 '