]>
Commit | Line | Data |
---|---|---|
15d3af5e JX |
1 | test_expect_success "setup proc-receive hook (ft, $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 | -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 |
13 | test_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 && | |
18 | cat >expect <<-EOF && | |
19 | remote: # pre-receive hook | |
8f0a2645 | 20 | remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic |
15d3af5e | 21 | remote: # proc-receive hook |
8f0a2645 JS |
22 | remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic |
23 | remote: proc-receive> ok refs/for/main/topic | |
15d3af5e JX |
24 | remote: proc-receive> option fall-through |
25 | remote: # post-receive hook | |
8f0a2645 | 26 | remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic |
15d3af5e | 27 | To <URL/of/upstream.git> |
8f0a2645 | 28 | * [new reference] <COMMIT-B> -> refs/for/main/topic |
15d3af5e JX |
29 | EOF |
30 | test_cmp expect actual && | |
31 | git -C "$upstream" show-ref >out && | |
32 | make_user_friendly_and_stable_output <out >actual && | |
33 | cat >expect <<-EOF && | |
8f0a2645 JS |
34 | <COMMIT-B> refs/for/main/topic |
35 | <COMMIT-A> refs/heads/main | |
15d3af5e JX |
36 | EOF |
37 | test_cmp expect actual | |
38 | ' | |
39 | ||
8f0a2645 JS |
40 | # Refs of upstream : main(A) refs/for/main/topic(A) |
41 | # Refs of workbench: main(A) tags/v123 | |
15d3af5e | 42 | test_expect_success "cleanup ($PROTOCOL)" ' |
8f0a2645 | 43 | git -C "$upstream" update-ref -d refs/for/main/topic |
15d3af5e | 44 | ' |