]> git.ipfire.org Git - thirdparty/git.git/blob - t/t5411/test-0030-report-ok.sh
The thirteenth batch
[thirdparty/git.git] / t / t5411 / test-0030-report-ok.sh
1 test_expect_success "setup proc-receive hook (ok, $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/main/topic"
6 EOF
7 '
8
9 # Refs of upstream : main(A)
10 # Refs of workbench: main(A) tags/v123
11 # git push : refs/for/main/topic
12 test_expect_success "proc-receive: ok ($PROTOCOL)" '
13 git -C workbench push origin \
14 HEAD:refs/for/main/topic \
15 >out 2>&1 &&
16 make_user_friendly_and_stable_output <out >actual &&
17 format_and_save_expect <<-EOF &&
18 > remote: # pre-receive hook Z
19 > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z
20 > remote: # proc-receive hook Z
21 > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z
22 > remote: proc-receive> ok refs/for/main/topic Z
23 > remote: # post-receive hook Z
24 > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z
25 > To <URL/of/upstream.git>
26 > * [new reference] HEAD -> refs/for/main/topic
27 EOF
28 test_cmp expect actual &&
29
30 test_cmp_refs -C "$upstream" <<-EOF
31 <COMMIT-A> refs/heads/main
32 EOF
33 '