Merge tag 'l10n-2.31.0-rnd2' of git://github.com/git-l10n/git-po
[git/debian.git] / t / t5411 / test-0031-report-ok--porcelain.sh
bloba967718046491f34b7afe4d85a1e23657da44b2b
1 test_expect_success "setup proc-receive hook (ok, $PROTOCOL/porcelain)" '
2 write_script "$upstream/hooks/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
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/porcelain)" '
13 git -C workbench push --porcelain origin \
14 HEAD:refs/for/main/topic \
15 >out 2>&1 &&
16 make_user_friendly_and_stable_output <out >actual &&
17 cat >expect <<-EOF &&
18 remote: # pre-receive hook
19 remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
20 remote: # proc-receive hook
21 remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
22 remote: proc-receive> ok refs/for/main/topic
23 remote: # post-receive hook
24 remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic
25 To <URL/of/upstream.git>
26 * HEAD:refs/for/main/topic [new reference]
27 Done
28 EOF
29 test_cmp expect actual &&
31 test_cmp_refs -C "$upstream" <<-EOF
32 <COMMIT-A> refs/heads/main
33 EOF