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-0040-process-all-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-0040-process-all-refs.sh` 111 lines ยท 4474 bytes Raw Blame History 1 test_expect_success "config receive.procReceiveRefs = refs ($PROTOCOL)" ' 2 git -C "$upstream" config --unset-all receive.procReceiveRefs && 3 git -C "$upstream" config --add receive.procReceiveRefs refs 4 ' 5 6 # Refs of upstream : main(A) 7 # Refs of workbench: main(A) tags/v123 8 test_expect_success "setup upstream branches ($PROTOCOL)" ' 9 ( 10 cd "$upstream" && 11 git update-ref refs/heads/main $B && 12 git update-ref refs/heads/foo $A && 13 git update-ref refs/heads/bar $A && 14 git update-ref refs/heads/baz $A 15 ) 16 17 ' 18 19 test_expect_success "setup proc-receive hook ($PROTOCOL)" ' 20 test_hook -C "$upstream" --clobber proc-receive <<-EOF 21 printf >&2 "# proc-receive hook\n" 22 test-tool proc-receive -v \ 23 -r "ok refs/heads/main" \ 24 -r "option fall-through" \ 25 -r "ok refs/heads/foo" \ 26 -r "option fall-through" \ 27 -r "ok refs/heads/bar" \ 28 -r "option fall-through" \ 29 -r "ok refs/for/main/topic" \ 30 -r "option refname refs/pull/123/head" \ 31 -r "option old-oid $A" \ 32 -r "option new-oid $B" \ 33 -r "ok refs/for/next/topic" \ 34 -r "option refname refs/pull/124/head" \ 35 -r "option old-oid $B" \ 36 -r "option new-oid $A" \ 37 -r "option forced-update" 38 EOF 39 ' 40 41 # Refs of upstream : main(B) foo(A) bar(A)) baz(A) 42 # Refs of workbench: main(A) tags/v123 43 # git push -f : main(A) (NULL) (B) refs/for/main/topic(A) refs/for/next/topic(A) 44 test_expect_success "proc-receive: process all refs ($PROTOCOL)" ' 45 git -C workbench push -f origin \ 46 HEAD:refs/heads/main \ 47 :refs/heads/foo \ 48 $B:refs/heads/bar \ 49 HEAD:refs/for/main/topic \ 50 HEAD:refs/for/next/topic \ 51 >out 2>&1 && 52 make_user_friendly_and_stable_output actual && 53 format_and_save_expect <<-EOF && 54 > remote: # pre-receive hook Z 55 > remote: pre-receive< refs/heads/bar Z 56 > remote: pre-receive< refs/heads/foo Z 57 > remote: pre-receive< refs/heads/main Z 58 > remote: pre-receive< refs/for/main/topic Z 59 > remote: pre-receive< refs/for/next/topic Z 60 > remote: # proc-receive hook Z 61 > remote: proc-receive< refs/heads/bar Z 62 > remote: proc-receive< refs/heads/foo Z 63 > remote: proc-receive< refs/heads/main Z 64 > remote: proc-receive< refs/for/main/topic Z 65 > remote: proc-receive< refs/for/next/topic Z 66 > remote: proc-receive> ok refs/heads/main Z 67 > remote: proc-receive> option fall-through Z 68 > remote: proc-receive> ok refs/heads/foo Z 69 > remote: proc-receive> option fall-through Z 70 > remote: proc-receive> ok refs/heads/bar Z 71 > remote: proc-receive> option fall-through Z 72 > remote: proc-receive> ok refs/for/main/topic Z 73 > remote: proc-receive> option refname refs/pull/123/head Z 74 > remote: proc-receive> option old-oid Z 75 > remote: proc-receive> option new-oid Z 76 > remote: proc-receive> ok refs/for/next/topic Z 77 > remote: proc-receive> option refname refs/pull/124/head Z 78 > remote: proc-receive> option old-oid Z 79 > remote: proc-receive> option new-oid Z 80 > remote: proc-receive> option forced-update Z 81 > remote: # post-receive hook Z 82 > remote: post-receive< refs/heads/bar Z 83 > remote: post-receive< refs/heads/foo Z 84 > remote: post-receive< refs/heads/main Z 85 > remote: post-receive< refs/pull/123/head Z 86 > remote: post-receive< refs/pull/124/head Z 87 > To 88 > .. -> bar 89 > - [deleted] foo 90 > + ... HEAD -> main (forced update) 91 > .. HEAD -> refs/pull/123/head 92 > + ... HEAD -> refs/pull/124/head (forced update) 93 EOF 94 test_cmp expect actual && 95 96 test_cmp_refs -C "$upstream" <<-EOF 97 refs/heads/bar 98 refs/heads/baz 99 refs/heads/main 100 EOF 101 ' 102 103 # Refs of upstream : main(A) bar(A) baz(B) 104 # Refs of workbench: main(A) tags/v123 105 test_expect_success "cleanup ($PROTOCOL)" ' 106 ( 107 cd "$upstream" && 108 git update-ref -d refs/heads/bar && 109 git update-ref -d refs/heads/baz 110 ) 111 '