Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t/t5411
diff options
context:
space:
mode:
authorJiang Xin <zhiyou.jx@alibaba-inc.com>2020-08-27 18:45:45 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-27 22:47:47 +0300
commit195d6eaea3b886fe13f422ce6675009ea1351224 (patch)
treeffa63b89707297aab755c9d2e7a939dce241abac /t/t5411
parent15d3af5e22eceb9cd6cd341703d612a62194451e (diff)
receive-pack: feed report options to post-receive
When commands are fed to the "post-receive" hook, report options will be parsed and the real old-oid, new-oid, reference name will feed to the "post-receive" hook. Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5411')
-rw-r--r--t/t5411/test-0032-report-with-options.sh14
-rw-r--r--t/t5411/test-0033-report-with-options--porcelain.sh14
-rw-r--r--t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh11
-rw-r--r--t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh11
-rw-r--r--t/t5411/test-0038-report-mixed-refs.sh2
-rw-r--r--t/t5411/test-0039-report-mixed-refs--porcelain.sh2
6 files changed, 32 insertions, 22 deletions
diff --git a/t/t5411/test-0032-report-with-options.sh b/t/t5411/test-0032-report-with-options.sh
index a743aa8018..c559c207fa 100644
--- a/t/t5411/test-0032-report-with-options.sh
+++ b/t/t5411/test-0032-report-with-options.sh
@@ -54,7 +54,7 @@ test_expect_success "proc-receive: report option refname ($PROTOCOL)" '
remote: proc-receive> ok refs/for/master/topic
remote: proc-receive> option refname refs/pull/123/head
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -87,7 +87,7 @@ test_expect_success "proc-receive: report option refname and forced-update ($PRO
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option forced-update
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -121,7 +121,7 @@ test_expect_success "proc-receive: report option refname and old-oid ($PROTOCOL)
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/123/head
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -153,7 +153,7 @@ test_expect_success "proc-receive: report option old-oid ($PROTOCOL)" '
remote: proc-receive> ok refs/for/master/topic
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/master/topic
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -187,7 +187,7 @@ test_expect_success "proc-receive: report option old-oid and new-oid ($PROTOCOL)
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -237,9 +237,9 @@ test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL)" '
remote: proc-receive> option forced-update
remote: proc-receive> option new-oid <COMMIT-A>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/next/topic
* [new reference] HEAD -> refs/for/a/b/c/topic
diff --git a/t/t5411/test-0033-report-with-options--porcelain.sh b/t/t5411/test-0033-report-with-options--porcelain.sh
index 439b97b06e..ea9312234e 100644
--- a/t/t5411/test-0033-report-with-options--porcelain.sh
+++ b/t/t5411/test-0033-report-with-options--porcelain.sh
@@ -55,7 +55,7 @@ test_expect_success "proc-receive: report option refname ($PROTOCOL/porcelain)"
remote: proc-receive> ok refs/for/master/topic
remote: proc-receive> option refname refs/pull/123/head
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -90,7 +90,7 @@ test_expect_success "proc-receive: report option refname and forced-update ($PRO
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option forced-update
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -125,7 +125,7 @@ test_expect_success "proc-receive: report option refname and old-oid ($PROTOCOL/
remote: proc-receive> option refname refs/pull/123/head
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/123/head
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -158,7 +158,7 @@ test_expect_success "proc-receive: report option old-oid ($PROTOCOL/porcelain)"
remote: proc-receive> ok refs/for/master/topic
remote: proc-receive> option old-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/master/topic
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -193,7 +193,7 @@ test_expect_success "proc-receive: report option old-oid and new-oid ($PROTOCOL/
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -245,9 +245,9 @@ test_expect_success "proc-receive: report with multiple rewrites ($PROTOCOL/porc
remote: proc-receive> option forced-update
remote: proc-receive> option new-oid <COMMIT-A>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head
To <URL/of/upstream.git>
* HEAD:refs/for/next/topic [new reference]
* HEAD:refs/for/a/b/c/topic [new reference]
diff --git a/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh b/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
index 12acf9ea1f..67cc4a8a4c 100644
--- a/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
+++ b/t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
@@ -41,7 +41,9 @@ test_expect_success "proc-receive: multiple rewrite for one ref, no refname for
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -99,7 +101,9 @@ test_expect_success "proc-receive: multiple rewrites for one ref, no refname for
remote: proc-receive> option new-oid <COMMIT-A>
remote: proc-receive> option forced-update
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
@@ -145,7 +149,8 @@ test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL)" '
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/23/123/1
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/24/124/2
To <URL/of/upstream.git>
* [new reference] HEAD -> refs/for/master/topic
EOF
diff --git a/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh b/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
index f4a2c56e14..1dc8551bc6 100644
--- a/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
+++ b/t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
@@ -41,7 +41,9 @@ test_expect_success "proc-receive: multiple rewrite for one ref, no refname for
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -100,7 +102,9 @@ test_expect_success "proc-receive: multiple rewrites for one ref, no refname for
remote: proc-receive> option new-oid <COMMIT-A>
remote: proc-receive> option forced-update
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
+ remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
@@ -147,7 +151,8 @@ test_expect_success "proc-receive: multiple rewrites for one ref ($PROTOCOL/porc
remote: proc-receive> option old-oid <COMMIT-A>
remote: proc-receive> option new-oid <COMMIT-B>
remote: # post-receive hook
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/23/123/1
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/24/124/2
To <URL/of/upstream.git>
* HEAD:refs/for/master/topic [new reference]
Done
diff --git a/t/t5411/test-0038-report-mixed-refs.sh b/t/t5411/test-0038-report-mixed-refs.sh
index 1dd6a97a97..bfc8d586d6 100644
--- a/t/t5411/test-0038-report-mixed-refs.sh
+++ b/t/t5411/test-0038-report-mixed-refs.sh
@@ -53,7 +53,7 @@ test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL)" '
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
To <URL/of/upstream.git>
<OID-A>..<OID-B> <COMMIT-B> -> master
* [new branch] HEAD -> bar
diff --git a/t/t5411/test-0039-report-mixed-refs--porcelain.sh b/t/t5411/test-0039-report-mixed-refs--porcelain.sh
index 32ebf63dcf..5d021a4837 100644
--- a/t/t5411/test-0039-report-mixed-refs--porcelain.sh
+++ b/t/t5411/test-0039-report-mixed-refs--porcelain.sh
@@ -53,7 +53,7 @@ test_expect_success "proc-receive: report update of mixed refs ($PROTOCOL/porcel
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2
remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo
- remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/master/topic
+ remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/master/topic
To <URL/of/upstream.git>
<COMMIT-B>:refs/heads/master <OID-A>..<OID-B>
* HEAD:refs/heads/bar [new branch]