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-0038-report-mixed-refs.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-0038-report-mixed-refs.sh` 87 lines ยท 3862 bytes Raw Blame History 1 test_expect_success "setup proc-receive hook ($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/for/next/topic2" \ 6 -r "ng refs/for/next/topic1 fail to call Web API" \ 7 -r "ok refs/for/main/topic" \ 8 -r "option refname refs/for/main/topic" \ 9 -r "option old-oid $A" \ 10 -r "option new-oid $B" 11 EOF 12 ' 13 14 # Refs of upstream : main(A) 15 # Refs of workbench: main(A) tags/v123 16 # git push : (B) bar(A) baz(A) refs/for/next/topic(A) foo(A) refs/for/main/topic(A) 17 test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL)" ' 18 test_must_fail git -C workbench push origin \ 19 $B:refs/heads/main \ 20 HEAD:refs/heads/bar \ 21 HEAD:refs/heads/baz \ 22 HEAD:refs/for/next/topic2 \ 23 HEAD:refs/for/next/topic1 \ 24 HEAD:refs/heads/foo \ 25 HEAD:refs/for/main/topic \ 26 HEAD:refs/for/next/topic3 \ 27 >out-$test_count 2>&1 && 28 make_user_friendly_and_stable_output actual && 29 format_and_save_expect <<-EOF && 30 > remote: # pre-receive hook Z 31 > remote: pre-receive< refs/heads/main Z 32 > remote: pre-receive< refs/heads/bar Z 33 > remote: pre-receive< refs/heads/baz Z 34 > remote: pre-receive< refs/for/next/topic2 Z 35 > remote: pre-receive< refs/for/next/topic1 Z 36 > remote: pre-receive< refs/heads/foo Z 37 > remote: pre-receive< refs/for/main/topic Z 38 > remote: pre-receive< refs/for/next/topic3 Z 39 > remote: # proc-receive hook Z 40 > remote: proc-receive< refs/for/next/topic2 Z 41 > remote: proc-receive< refs/for/next/topic1 Z 42 > remote: proc-receive< refs/for/main/topic Z 43 > remote: proc-receive< refs/for/next/topic3 Z 44 > remote: proc-receive> ok refs/for/next/topic2 Z 45 > remote: proc-receive> ng refs/for/next/topic1 fail to call Web API Z 46 > remote: proc-receive> ok refs/for/main/topic Z 47 > remote: proc-receive> option refname refs/for/main/topic Z 48 > remote: proc-receive> option old-oid Z 49 > remote: proc-receive> option new-oid Z 50 > remote: # post-receive hook Z 51 > remote: post-receive< refs/heads/main Z 52 > remote: post-receive< refs/heads/bar Z 53 > remote: post-receive< refs/heads/baz Z 54 > remote: post-receive< refs/for/next/topic2 Z 55 > remote: post-receive< refs/heads/foo Z 56 > remote: post-receive< refs/for/main/topic Z 57 > To 58 > .. -> main 59 > * [new branch] HEAD -> bar 60 > * [new branch] HEAD -> baz 61 > * [new reference] HEAD -> refs/for/next/topic2 62 > * [new branch] HEAD -> foo 63 > .. HEAD -> refs/for/main/topic 64 > ! [remote rejected] HEAD -> refs/for/next/topic1 (fail to call Web API) 65 > ! [remote rejected] HEAD -> refs/for/next/topic3 (proc-receive failed to report status) 66 EOF 67 test_cmp expect actual && 68 69 test_cmp_refs -C "$upstream" <<-EOF 70 refs/heads/bar 71 refs/heads/baz 72 refs/heads/foo 73 refs/heads/main 74 EOF 75 ' 76 77 # Refs of upstream : main(B) foo(A) bar(A)) baz(A) 78 # Refs of workbench: main(A) tags/v123 79 test_expect_success "cleanup ($PROTOCOL)" ' 80 ( 81 cd "$upstream" && 82 git update-ref refs/heads/main $A && 83 git update-ref -d refs/heads/foo && 84 git update-ref -d refs/heads/bar && 85 git update-ref -d refs/heads/baz 86 ) 87 '