]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5411/test-0034-report-ft.sh
Merge branch 'jp/use-diff-index-in-pre-commit-sample' into maint-2.43
[thirdparty/git.git] / t / t5411 / test-0034-report-ft.sh
CommitLineData
15d3af5e 1test_expect_success "setup proc-receive hook (ft, $PROTOCOL)" '
c39176b1 2 test_hook -C "$upstream" --clobber proc-receive <<-\EOF
15d3af5e
JX
3 printf >&2 "# proc-receive hook\n"
4 test-tool proc-receive -v \
8f0a2645 5 -r "ok refs/for/main/topic" \
15d3af5e
JX
6 -r "option fall-through"
7 EOF
8'
9
8f0a2645
JS
10# Refs of upstream : main(A)
11# Refs of workbench: main(A) tags/v123
12# git push : refs/for/main/topic(B)
15d3af5e
JX
13test_expect_success "proc-receive: fall throught, let receive-pack to execute ($PROTOCOL)" '
14 git -C workbench push origin \
8f0a2645 15 $B:refs/for/main/topic \
15d3af5e
JX
16 >out 2>&1 &&
17 make_user_friendly_and_stable_output <out >actual &&
2bafb3d7
JX
18 format_and_save_expect <<-EOF &&
19 > remote: # pre-receive hook Z
20 > remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic Z
21 > remote: # proc-receive hook Z
22 > remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic Z
23 > remote: proc-receive> ok refs/for/main/topic Z
24 > remote: proc-receive> option fall-through Z
25 > remote: # post-receive hook Z
26 > remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic Z
27 > To <URL/of/upstream.git>
28 > * [new reference] <COMMIT-B> -> refs/for/main/topic
15d3af5e
JX
29 EOF
30 test_cmp expect actual &&
822ee894
JX
31
32 test_cmp_refs -C "$upstream" <<-EOF
8f0a2645
JS
33 <COMMIT-B> refs/for/main/topic
34 <COMMIT-A> refs/heads/main
15d3af5e 35 EOF
15d3af5e
JX
36'
37
8f0a2645
JS
38# Refs of upstream : main(A) refs/for/main/topic(A)
39# Refs of workbench: main(A) tags/v123
15d3af5e 40test_expect_success "cleanup ($PROTOCOL)" '
8f0a2645 41 git -C "$upstream" update-ref -d refs/for/main/topic
15d3af5e 42'