]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5411/test-0030-report-ok.sh
Merge branch 'pk/subsub-fetch-fix-take-2' into maint
[thirdparty/git.git] / t / t5411 / test-0030-report-ok.sh
CommitLineData
15d3af5e
JX
1test_expect_success "setup proc-receive hook (ok, $PROTOCOL)" '
2 write_script "$upstream/hooks/proc-receive" <<-EOF
3 printf >&2 "# proc-receive hook\n"
4 test-tool proc-receive -v \
8f0a2645 5 -r "ok refs/for/main/topic"
15d3af5e
JX
6 EOF
7'
8
8f0a2645
JS
9# Refs of upstream : main(A)
10# Refs of workbench: main(A) tags/v123
11# git push : refs/for/main/topic
15d3af5e
JX
12test_expect_success "proc-receive: ok ($PROTOCOL)" '
13 git -C workbench push origin \
8f0a2645 14 HEAD:refs/for/main/topic \
15d3af5e
JX
15 >out 2>&1 &&
16 make_user_friendly_and_stable_output <out >actual &&
17 cat >expect <<-EOF &&
18 remote: # pre-receive hook
8f0a2645 19 remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
15d3af5e 20 remote: # proc-receive hook
8f0a2645
JS
21 remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
22 remote: proc-receive> ok refs/for/main/topic
15d3af5e 23 remote: # post-receive hook
8f0a2645 24 remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
15d3af5e 25 To <URL/of/upstream.git>
8f0a2645 26 * [new reference] HEAD -> refs/for/main/topic
15d3af5e
JX
27 EOF
28 test_cmp expect actual &&
29 git -C "$upstream" show-ref >out &&
30 make_user_friendly_and_stable_output <out >actual &&
31 cat >expect <<-EOF &&
8f0a2645 32 <COMMIT-A> refs/heads/main
15d3af5e
JX
33 EOF
34 test_cmp expect actual
35'