Git fork

test: compare raw output, not mangle tabs and spaces

Before comparing with the expect file, we used to call function
"make_user_friendly_and_stable_output" to filter out trailing spaces in
output. Ævar recommends using pattern "s/Z$//" to prepare expect file,
and then compare it with raw output.

Since we have fixed the issue of occasionally missing the clear-to-eol
suffix when displaying sideband #2 messages, it is safe and stable to
test against raw output.

Suggested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Jiang Xin and committed by
Junio C Hamano
2bafb3d7 5210225f

+972 -966
+5 -4
t/t5411/common-functions.sh
··· 33 33 34 34 # Format the output of git-push, git-show-ref and other commands to make a 35 35 # user-friendly and stable text. We can easily prepare the expect text 36 - # without having to worry about future changes of the commit ID and spaces 36 + # without having to worry about changes of the commit ID (full or abbrev.) 37 37 # of the output. Single quotes are replaced with double quotes, because 38 38 # it is boring to prepare unquoted single quotes in expect text. We also 39 39 # remove some locale error messages. The emitted human-readable errors are 40 40 # redundant to the more machine-readable output the tests already assert. 41 41 make_user_friendly_and_stable_output () { 42 42 sed \ 43 - -e "s/ *\$//" \ 44 - -e "s/ */ /g" \ 45 43 -e "s/'/\"/g" \ 46 - -e "s/ / /g" \ 47 44 -e "s/$A/<COMMIT-A>/g" \ 48 45 -e "s/$B/<COMMIT-B>/g" \ 49 46 -e "s/$TAG/<TAG-v123>/g" \ ··· 57 54 filter_out_user_friendly_and_stable_output () { 58 55 make_user_friendly_and_stable_output | 59 56 sed -n ${1+"$@"} 57 + } 58 + 59 + format_and_save_expect () { 60 + sed -e 's/^> //' -e 's/Z$//' >expect 60 61 } 61 62 62 63 test_cmp_refs () {
+41 -41
t/t5411/test-0000-standard-git-push.sh
··· 7 7 HEAD:refs/heads/next \ 8 8 >out 2>&1 && 9 9 make_user_friendly_and_stable_output <out >actual && 10 - cat >expect <<-EOF && 11 - remote: # pre-receive hook 12 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 13 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 14 - remote: # post-receive hook 15 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 16 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 17 - To <URL/of/upstream.git> 18 - <OID-A>..<OID-B> <COMMIT-B> -> main 19 - * [new branch] HEAD -> next 10 + format_and_save_expect <<-EOF && 11 + > remote: # pre-receive hook Z 12 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 13 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 14 + > remote: # post-receive hook Z 15 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 16 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 17 + > To <URL/of/upstream.git> 18 + > <OID-A>..<OID-B> <COMMIT-B> -> main 19 + > * [new branch] HEAD -> next 20 20 EOF 21 21 test_cmp expect actual && 22 22 ··· 38 38 -e "/^To / { p; }" \ 39 39 -e "/^ ! / { p; }" \ 40 40 <out-$test_count >actual && 41 - cat >expect <<-EOF && 42 - To <URL/of/upstream.git> 43 - ! [rejected] main -> main (non-fast-forward) 44 - ! [rejected] <COMMIT-B> -> next (atomic push failed) 41 + format_and_save_expect <<-EOF && 42 + > To <URL/of/upstream.git> 43 + > ! [rejected] main -> main (non-fast-forward) 44 + > ! [rejected] <COMMIT-B> -> next (atomic push failed) 45 45 EOF 46 46 test_cmp expect actual && 47 47 ··· 63 63 $B:refs/heads/next \ 64 64 >out-$test_count 2>&1 && 65 65 make_user_friendly_and_stable_output <out-$test_count >actual && 66 - cat >expect <<-EOF && 67 - remote: # pre-receive hook 68 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/next 69 - remote: # post-receive hook 70 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next 71 - To <URL/of/upstream.git> 72 - <OID-A>..<OID-B> <COMMIT-B> -> next 73 - ! [rejected] main -> main (non-fast-forward) 66 + format_and_save_expect <<-EOF && 67 + > remote: # pre-receive hook Z 68 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/next Z 69 + > remote: # post-receive hook Z 70 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next Z 71 + > To <URL/of/upstream.git> 72 + > <OID-A>..<OID-B> <COMMIT-B> -> next 73 + > ! [rejected] main -> main (non-fast-forward) 74 74 EOF 75 75 test_cmp expect actual && 76 76 ··· 92 92 HEAD:refs/heads/a/b/c \ 93 93 >out 2>&1 && 94 94 make_user_friendly_and_stable_output <out >actual && 95 - cat >expect <<-EOF && 96 - remote: # pre-receive hook 97 - remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 98 - remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next 99 - remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 100 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic 101 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c 102 - remote: # post-receive hook 103 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 104 - remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next 105 - remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 106 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic 107 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c 108 - To <URL/of/upstream.git> 109 - + <OID-B>...<OID-A> main -> main (forced update) 110 - - [deleted] next 111 - * [new tag] v123 -> v123 112 - * [new reference] main -> refs/review/main/topic 113 - * [new branch] HEAD -> a/b/c 95 + format_and_save_expect <<-EOF && 96 + > remote: # pre-receive hook Z 97 + > remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 98 + > remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next Z 99 + > remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 Z 100 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic Z 101 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c Z 102 + > remote: # post-receive hook Z 103 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 104 + > remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next Z 105 + > remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 Z 106 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic Z 107 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c Z 108 + > To <URL/of/upstream.git> 109 + > + <OID-B>...<OID-A> main -> main (forced update) 110 + > - [deleted] next 111 + > * [new tag] v123 -> v123 112 + > * [new reference] main -> refs/review/main/topic 113 + > * [new branch] HEAD -> a/b/c 114 114 EOF 115 115 test_cmp expect actual && 116 116
+45 -45
t/t5411/test-0001-standard-git-push--porcelain.sh
··· 7 7 HEAD:refs/heads/next \ 8 8 >out 2>&1 && 9 9 make_user_friendly_and_stable_output <out >actual && 10 - cat >expect <<-EOF && 11 - remote: # pre-receive hook 12 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 13 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 14 - remote: # post-receive hook 15 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 16 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 17 - To <URL/of/upstream.git> 18 - <COMMIT-B>:refs/heads/main <OID-A>..<OID-B> 19 - * HEAD:refs/heads/next [new branch] 20 - Done 10 + format_and_save_expect <<-EOF && 11 + > remote: # pre-receive hook Z 12 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 13 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 14 + > remote: # post-receive hook Z 15 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 16 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 17 + > To <URL/of/upstream.git> 18 + > <COMMIT-B>:refs/heads/main <OID-A>..<OID-B> 19 + > * HEAD:refs/heads/next [new branch] 20 + > Done 21 21 EOF 22 22 test_cmp expect actual && 23 23 ··· 38 38 filter_out_user_friendly_and_stable_output \ 39 39 -e "s/^# GETTEXT POISON #//" \ 40 40 -e "/^To / { p; }" \ 41 - -e "/^! / { p; }" \ 41 + -e "/^!/ { p; }" \ 42 42 <out-$test_count >actual && 43 - cat >expect <<-EOF && 44 - To <URL/of/upstream.git> 45 - ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward) 46 - ! <COMMIT-B>:refs/heads/next [rejected] (atomic push failed) 43 + format_and_save_expect <<-EOF && 44 + > To <URL/of/upstream.git> 45 + > ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward) 46 + > ! <COMMIT-B>:refs/heads/next [rejected] (atomic push failed) 47 47 EOF 48 48 test_cmp expect actual && 49 49 ··· 65 65 $B:refs/heads/next \ 66 66 >out-$test_count 2>&1 && 67 67 make_user_friendly_and_stable_output <out-$test_count >actual && 68 - cat >expect <<-EOF && 69 - remote: # pre-receive hook 70 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/next 71 - remote: # post-receive hook 72 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next 73 - To <URL/of/upstream.git> 74 - <COMMIT-B>:refs/heads/next <OID-A>..<OID-B> 75 - ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward) 76 - Done 68 + format_and_save_expect <<-EOF && 69 + > remote: # pre-receive hook Z 70 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/next Z 71 + > remote: # post-receive hook Z 72 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/next Z 73 + > To <URL/of/upstream.git> 74 + > <COMMIT-B>:refs/heads/next <OID-A>..<OID-B> 75 + > ! refs/heads/main:refs/heads/main [rejected] (non-fast-forward) 76 + > Done 77 77 EOF 78 78 test_cmp expect actual && 79 79 ··· 95 95 HEAD:refs/heads/a/b/c \ 96 96 >out 2>&1 && 97 97 make_user_friendly_and_stable_output <out >actual && 98 - cat >expect <<-EOF && 99 - remote: # pre-receive hook 100 - remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 101 - remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next 102 - remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 103 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic 104 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c 105 - remote: # post-receive hook 106 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 107 - remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next 108 - remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 109 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic 110 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c 111 - To <URL/of/upstream.git> 112 - + refs/heads/main:refs/heads/main <OID-B>...<OID-A> (forced update) 113 - - :refs/heads/next [deleted] 114 - * refs/tags/v123:refs/tags/v123 [new tag] 115 - * refs/heads/main:refs/review/main/topic [new reference] 116 - * HEAD:refs/heads/a/b/c [new branch] 117 - Done 98 + format_and_save_expect <<-EOF && 99 + > remote: # pre-receive hook Z 100 + > remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 101 + > remote: pre-receive< <COMMIT-B> <ZERO-OID> refs/heads/next Z 102 + > remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 Z 103 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic Z 104 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c Z 105 + > remote: # post-receive hook Z 106 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 107 + > remote: post-receive< <COMMIT-B> <ZERO-OID> refs/heads/next Z 108 + > remote: post-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 Z 109 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/review/main/topic Z 110 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/a/b/c Z 111 + > To <URL/of/upstream.git> 112 + > + refs/heads/main:refs/heads/main <OID-B>...<OID-A> (forced update) 113 + > - :refs/heads/next [deleted] 114 + > * refs/tags/v123:refs/tags/v123 [new tag] 115 + > * refs/heads/main:refs/review/main/topic [new reference] 116 + > * HEAD:refs/heads/a/b/c [new branch] 117 + > Done 118 118 EOF 119 119 test_cmp expect actual && 120 120
+4 -4
t/t5411/test-0003-pre-receive-declined--porcelain.sh
··· 14 14 HEAD:refs/heads/next \ 15 15 >out-$test_count 2>&1 && 16 16 make_user_friendly_and_stable_output <out-$test_count >actual && 17 - cat >expect <<-EOF && 18 - To <URL/of/upstream.git> 19 - ! <COMMIT-B>:refs/heads/main [remote rejected] (pre-receive hook declined) 20 - ! HEAD:refs/heads/next [remote rejected] (pre-receive hook declined) 17 + format_and_save_expect <<-EOF && 18 + > To <URL/of/upstream.git> 19 + > ! <COMMIT-B>:refs/heads/main [remote rejected] (pre-receive hook declined) 20 + > ! HEAD:refs/heads/next [remote rejected] (pre-receive hook declined) 21 21 Done 22 22 EOF 23 23 test_cmp expect actual &&
+20 -20
t/t5411/test-0011-no-hook-error.sh
··· 7 7 HEAD:refs/for/main/topic \ 8 8 >out-$test_count 2>&1 && 9 9 make_user_friendly_and_stable_output <out-$test_count >actual && 10 - cat >expect <<-EOF && 11 - remote: # pre-receive hook 12 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 13 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 14 - remote: error: cannot find hook "proc-receive" 15 - remote: # post-receive hook 16 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 17 - To <URL/of/upstream.git> 18 - * [new branch] HEAD -> next 19 - ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook) 10 + format_and_save_expect <<-EOF && 11 + > remote: # pre-receive hook Z 12 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 13 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 14 + > remote: error: cannot find hook "proc-receive" Z 15 + > remote: # post-receive hook Z 16 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 17 + > To <URL/of/upstream.git> 18 + > * [new branch] HEAD -> next 19 + > ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook) 20 20 EOF 21 21 test_cmp expect actual && 22 22 ··· 41 41 HEAD:next \ 42 42 HEAD:refs/for/main/topic >out-$test_count 2>&1 && 43 43 make_user_friendly_and_stable_output <out-$test_count >actual && 44 - cat >expect <<-EOF && 45 - remote: # pre-receive hook 46 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 47 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 48 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 49 - remote: error: cannot find hook "proc-receive" 50 - To <URL/of/upstream.git> 51 - ! [remote rejected] <COMMIT-B> -> main (fail to run proc-receive hook) 52 - ! [remote rejected] HEAD -> next (fail to run proc-receive hook) 53 - ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook) 44 + format_and_save_expect <<-EOF && 45 + > remote: # pre-receive hook Z 46 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 47 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 48 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 49 + > remote: error: cannot find hook "proc-receive" Z 50 + > To <URL/of/upstream.git> 51 + > ! [remote rejected] <COMMIT-B> -> main (fail to run proc-receive hook) 52 + > ! [remote rejected] HEAD -> next (fail to run proc-receive hook) 53 + > ! [remote rejected] HEAD -> refs/for/main/topic (fail to run proc-receive hook) 54 54 EOF 55 55 test_cmp expect actual && 56 56
+21 -21
t/t5411/test-0012-no-hook-error--porcelain.sh
··· 7 7 HEAD:refs/for/main/topic \ 8 8 >out-$test_count 2>&1 && 9 9 make_user_friendly_and_stable_output <out-$test_count >actual && 10 - cat >expect <<-EOF && 11 - remote: # pre-receive hook 12 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 13 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 14 - remote: error: cannot find hook "proc-receive" 15 - remote: # post-receive hook 16 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 17 - To <URL/of/upstream.git> 18 - * HEAD:refs/heads/next [new branch] 19 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 10 + format_and_save_expect <<-EOF && 11 + > remote: # pre-receive hook Z 12 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 13 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 14 + > remote: error: cannot find hook "proc-receive" Z 15 + > remote: # post-receive hook Z 16 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 17 + > To <URL/of/upstream.git> 18 + > * HEAD:refs/heads/next [new branch] 19 + > ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 20 20 Done 21 21 EOF 22 22 test_cmp expect actual && ··· 42 42 HEAD:next \ 43 43 HEAD:refs/for/main/topic >out-$test_count 2>&1 && 44 44 make_user_friendly_and_stable_output <out-$test_count >actual && 45 - cat >expect <<-EOF && 46 - remote: # pre-receive hook 47 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 48 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 49 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 50 - remote: error: cannot find hook "proc-receive" 51 - To <URL/of/upstream.git> 52 - ! <COMMIT-B>:refs/heads/main [remote rejected] (fail to run proc-receive hook) 53 - ! HEAD:refs/heads/next [remote rejected] (fail to run proc-receive hook) 54 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 55 - Done 45 + format_and_save_expect <<-EOF && 46 + > remote: # pre-receive hook Z 47 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 48 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 49 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 50 + > remote: error: cannot find hook "proc-receive" Z 51 + > To <URL/of/upstream.git> 52 + > ! <COMMIT-B>:refs/heads/main [remote rejected] (fail to run proc-receive hook) 53 + > ! HEAD:refs/heads/next [remote rejected] (fail to run proc-receive hook) 54 + > ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 55 + > Done 56 56 EOF 57 57 test_cmp expect actual && 58 58
+31 -31
t/t5411/test-0013-bad-protocol.sh
··· 29 29 # message ("remote: fatal: the remote end hung up unexpectedly") which 30 30 # is different from the remote HTTP server with different locale settings. 31 31 grep "^remote: error:" <actual >actual-error && 32 - cat >expect <<-EOF && 33 - remote: error: proc-receive version "2" is not supported 32 + format_and_save_expect <<-EOF && 33 + > remote: error: proc-receive version "2" is not supported Z 34 34 EOF 35 35 test_cmp expect actual-error && 36 36 ··· 208 208 HEAD:refs/heads/next \ 209 209 HEAD:refs/for/main/topic >out-$test_count 2>&1 && 210 210 make_user_friendly_and_stable_output <out-$test_count >actual && 211 - cat >expect <<-EOF && 212 - remote: # pre-receive hook 213 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 214 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 215 - remote: # proc-receive hook 216 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 217 - remote: # post-receive hook 218 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 219 - To <URL/of/upstream.git> 220 - * [new branch] HEAD -> next 221 - ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 211 + format_and_save_expect <<-EOF && 212 + > remote: # pre-receive hook Z 213 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 214 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 215 + > remote: # proc-receive hook Z 216 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 217 + > remote: # post-receive hook Z 218 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 219 + > To <URL/of/upstream.git> 220 + > * [new branch] HEAD -> next 221 + > ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 222 222 EOF 223 223 test_cmp expect actual && 224 224 ··· 251 251 HEAD:refs/for/main/topic\ 252 252 >out-$test_count 2>&1 && 253 253 make_user_friendly_and_stable_output <out-$test_count >actual && 254 - cat >expect <<-EOF && 255 - remote: # pre-receive hook 256 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 257 - remote: # proc-receive hook 258 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 259 - remote: proc-receive> ok 260 - remote: error: proc-receive reported incomplete status line: "ok" 261 - To <URL/of/upstream.git> 262 - ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 254 + format_and_save_expect <<-EOF && 255 + > remote: # pre-receive hook Z 256 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 257 + > remote: # proc-receive hook Z 258 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 259 + > remote: proc-receive> ok Z 260 + > remote: error: proc-receive reported incomplete status line: "ok" Z 261 + > To <URL/of/upstream.git> 262 + > ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 263 263 EOF 264 264 test_cmp expect actual && 265 265 ··· 284 284 HEAD:refs/for/main/topic \ 285 285 >out-$test_count 2>&1 && 286 286 make_user_friendly_and_stable_output <out-$test_count >actual && 287 - cat >expect <<-EOF && 288 - remote: # pre-receive hook 289 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 290 - remote: # proc-receive hook 291 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 292 - remote: proc-receive> xx refs/for/main/topic 293 - remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic" 294 - To <URL/of/upstream.git> 295 - ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 287 + format_and_save_expect <<-EOF && 288 + > remote: # pre-receive hook Z 289 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 290 + > remote: # proc-receive hook Z 291 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 292 + > remote: proc-receive> xx refs/for/main/topic Z 293 + > remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic" Z 294 + > To <URL/of/upstream.git> 295 + > ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 296 296 EOF 297 297 test_cmp expect actual && 298 298
+40 -40
t/t5411/test-0014-bad-protocol--porcelain.sh
··· 20 20 <actual >actual-report && 21 21 cat >expect <<-EOF && 22 22 To <URL/of/upstream.git> 23 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 23 + ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 24 24 Done 25 25 EOF 26 26 test_cmp expect actual-report && ··· 29 29 # message ("remote: fatal: the remote end hung up unexpectedly") which 30 30 # is different from the remote HTTP server with different locale settings. 31 31 grep "^remote: error:" <actual >actual-error && 32 - cat >expect <<-EOF && 33 - remote: error: proc-receive version "2" is not supported 32 + format_and_save_expect <<-EOF && 33 + > remote: error: proc-receive version "2" is not supported Z 34 34 EOF 35 35 test_cmp expect actual-error && 36 36 ··· 58 58 <out-$test_count >actual && 59 59 cat >expect <<-EOF && 60 60 To <URL/of/upstream.git> 61 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 61 + ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 62 62 Done 63 63 EOF 64 64 test_cmp expect actual && ··· 89 89 <out-$test_count >actual && 90 90 cat >expect <<-EOF && 91 91 To <URL/of/upstream.git> 92 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 92 + ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 93 93 Done 94 94 EOF 95 95 test_cmp expect actual && ··· 120 120 <out-$test_count >actual && 121 121 cat >expect <<-EOF && 122 122 To <URL/of/upstream.git> 123 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 123 + ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 124 124 Done 125 125 EOF 126 126 test_cmp expect actual && ··· 152 152 <out-$test_count >actual && 153 153 cat >expect <<-EOF && 154 154 To <URL/of/upstream.git> 155 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 155 + ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 156 156 Done 157 157 EOF 158 158 test_cmp expect actual && ··· 182 182 <out-$test_count >actual && 183 183 cat >expect <<-EOF && 184 184 To <URL/of/upstream.git> 185 - ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 185 + ! HEAD:refs/for/main/topic [remote rejected] (fail to run proc-receive hook) 186 186 Done 187 187 EOF 188 188 test_cmp expect actual && ··· 208 208 HEAD:refs/heads/next \ 209 209 HEAD:refs/for/main/topic >out-$test_count 2>&1 && 210 210 make_user_friendly_and_stable_output <out-$test_count >actual && 211 - cat >expect <<-EOF && 212 - remote: # pre-receive hook 213 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 214 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 215 - remote: # proc-receive hook 216 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 217 - remote: # post-receive hook 218 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 219 - To <URL/of/upstream.git> 220 - * HEAD:refs/heads/next [new branch] 221 - ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 222 - Done 211 + format_and_save_expect <<-EOF && 212 + > remote: # pre-receive hook Z 213 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 214 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 215 + > remote: # proc-receive hook Z 216 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 217 + > remote: # post-receive hook Z 218 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 219 + > To <URL/of/upstream.git> 220 + > * HEAD:refs/heads/next [new branch] 221 + > ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 222 + > Done 223 223 EOF 224 224 test_cmp expect actual && 225 225 ··· 251 251 HEAD:refs/for/main/topic\ 252 252 >out-$test_count 2>&1 && 253 253 make_user_friendly_and_stable_output <out-$test_count >actual && 254 - cat >expect <<-EOF && 255 - remote: # pre-receive hook 256 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 257 - remote: # proc-receive hook 258 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 259 - remote: proc-receive> ok 260 - remote: error: proc-receive reported incomplete status line: "ok" 261 - To <URL/of/upstream.git> 262 - ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 263 - Done 254 + format_and_save_expect <<-EOF && 255 + > remote: # pre-receive hook Z 256 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 257 + > remote: # proc-receive hook Z 258 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 259 + > remote: proc-receive> ok Z 260 + > remote: error: proc-receive reported incomplete status line: "ok" Z 261 + > To <URL/of/upstream.git> 262 + > ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 263 + > Done 264 264 EOF 265 265 test_cmp expect actual && 266 266 ··· 285 285 HEAD:refs/for/main/topic \ 286 286 >out-$test_count 2>&1 && 287 287 make_user_friendly_and_stable_output <out-$test_count >actual && 288 - cat >expect <<-EOF && 289 - remote: # pre-receive hook 290 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 291 - remote: # proc-receive hook 292 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 293 - remote: proc-receive> xx refs/for/main/topic 294 - remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic" 295 - To <URL/of/upstream.git> 296 - ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 297 - Done 288 + format_and_save_expect <<-EOF && 289 + > remote: # pre-receive hook Z 290 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 291 + > remote: # proc-receive hook Z 292 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 293 + > remote: proc-receive> xx refs/for/main/topic Z 294 + > remote: error: proc-receive reported bad status "xx" on ref "refs/for/main/topic" Z 295 + > To <URL/of/upstream.git> 296 + > ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 297 + > Done 298 298 EOF 299 299 test_cmp expect actual && 300 300
+16 -16
t/t5411/test-0020-report-ng.sh
··· 14 14 HEAD:refs/for/main/topic \ 15 15 >out-$test_count 2>&1 && 16 16 make_user_friendly_and_stable_output <out-$test_count >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> ng refs/for/main/topic 23 - To <URL/of/upstream.git> 24 - ! [remote rejected] HEAD -> refs/for/main/topic (failed) 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> ng refs/for/main/topic Z 23 + > To <URL/of/upstream.git> 24 + > ! [remote rejected] HEAD -> refs/for/main/topic (failed) 25 25 EOF 26 26 test_cmp expect actual && 27 27 ··· 46 46 HEAD:refs/for/main/topic \ 47 47 >out-$test_count 2>&1 && 48 48 make_user_friendly_and_stable_output <out-$test_count >actual && 49 - cat >expect <<-EOF && 50 - remote: # pre-receive hook 51 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 52 - remote: # proc-receive hook 53 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 54 - remote: proc-receive> ng refs/for/main/topic error msg 55 - To <URL/of/upstream.git> 56 - ! [remote rejected] HEAD -> refs/for/main/topic (error msg) 49 + format_and_save_expect <<-EOF && 50 + > remote: # pre-receive hook Z 51 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 52 + > remote: # proc-receive hook Z 53 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 54 + > remote: proc-receive> ng refs/for/main/topic error msg Z 55 + > To <URL/of/upstream.git> 56 + > ! [remote rejected] HEAD -> refs/for/main/topic (error msg) 57 57 EOF 58 58 test_cmp expect actual && 59 59
+18 -18
t/t5411/test-0021-report-ng--porcelain.sh
··· 14 14 HEAD:refs/for/main/topic \ 15 15 >out-$test_count 2>&1 && 16 16 make_user_friendly_and_stable_output <out-$test_count >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> ng refs/for/main/topic 23 - To <URL/of/upstream.git> 24 - ! HEAD:refs/for/main/topic [remote rejected] (failed) 25 - Done 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> ng refs/for/main/topic Z 23 + > To <URL/of/upstream.git> 24 + > ! HEAD:refs/for/main/topic [remote rejected] (failed) 25 + > Done 26 26 EOF 27 27 test_cmp expect actual && 28 28 ··· 47 47 HEAD:refs/for/main/topic \ 48 48 >out-$test_count 2>&1 && 49 49 make_user_friendly_and_stable_output <out-$test_count >actual && 50 - cat >expect <<-EOF && 51 - remote: # pre-receive hook 52 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 53 - remote: # proc-receive hook 54 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 55 - remote: proc-receive> ng refs/for/main/topic error msg 56 - To <URL/of/upstream.git> 57 - ! HEAD:refs/for/main/topic [remote rejected] (error msg) 58 - Done 50 + format_and_save_expect <<-EOF && 51 + > remote: # pre-receive hook Z 52 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 53 + > remote: # proc-receive hook Z 54 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 55 + > remote: proc-receive> ng refs/for/main/topic error msg Z 56 + > To <URL/of/upstream.git> 57 + > ! HEAD:refs/for/main/topic [remote rejected] (error msg) 58 + > Done 59 59 EOF 60 60 test_cmp expect actual && 61 61
+13 -13
t/t5411/test-0022-report-unexpect-ref.sh
··· 15 15 HEAD:refs/for/main/topic \ 16 16 >out-$test_count 2>&1 && 17 17 make_user_friendly_and_stable_output <out-$test_count >actual && 18 - cat >expect <<-EOF && 19 - remote: # pre-receive hook 20 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 21 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 22 - remote: # proc-receive hook 23 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 24 - remote: proc-receive> ok refs/heads/main 25 - remote: error: proc-receive reported status on unexpected ref: refs/heads/main 26 - remote: # post-receive hook 27 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 28 - To <URL/of/upstream.git> 29 - <OID-A>..<OID-B> <COMMIT-B> -> main 30 - ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 18 + format_and_save_expect <<-EOF && 19 + > remote: # pre-receive hook Z 20 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 21 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 22 + > remote: # proc-receive hook Z 23 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 24 + > remote: proc-receive> ok refs/heads/main Z 25 + > remote: error: proc-receive reported status on unexpected ref: refs/heads/main Z 26 + > remote: # post-receive hook Z 27 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 28 + > To <URL/of/upstream.git> 29 + > <OID-A>..<OID-B> <COMMIT-B> -> main 30 + > ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 31 31 EOF 32 32 test_cmp expect actual && 33 33
+14 -14
t/t5411/test-0023-report-unexpect-ref--porcelain.sh
··· 15 15 HEAD:refs/for/main/topic \ 16 16 >out-$test_count 2>&1 && 17 17 make_user_friendly_and_stable_output <out-$test_count >actual && 18 - cat >expect <<-EOF && 19 - remote: # pre-receive hook 20 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 21 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 22 - remote: # proc-receive hook 23 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 24 - remote: proc-receive> ok refs/heads/main 25 - remote: error: proc-receive reported status on unexpected ref: refs/heads/main 26 - remote: # post-receive hook 27 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 28 - To <URL/of/upstream.git> 29 - <COMMIT-B>:refs/heads/main <OID-A>..<OID-B> 30 - ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 31 - Done 18 + format_and_save_expect <<-EOF && 19 + > remote: # pre-receive hook Z 20 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 21 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 22 + > remote: # proc-receive hook Z 23 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 24 + > remote: proc-receive> ok refs/heads/main Z 25 + > remote: error: proc-receive reported status on unexpected ref: refs/heads/main Z 26 + > remote: # post-receive hook Z 27 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 28 + > To <URL/of/upstream.git> 29 + > <COMMIT-B>:refs/heads/main <OID-A>..<OID-B> 30 + > ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 31 + > Done 32 32 EOF 33 33 test_cmp expect actual && 34 34
+9 -9
t/t5411/test-0024-report-unknown-ref.sh
··· 14 14 HEAD:refs/for/a/b/c/my/topic \ 15 15 >out-$test_count 2>&1 && 16 16 make_user_friendly_and_stable_output <out-$test_count >actual && 17 - cat >expect <<-EOF && 18 - remote: # pre-receive hook 19 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic 20 - remote: # proc-receive hook 21 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic 22 - remote: proc-receive> ok refs/for/main/topic 23 - remote: error: proc-receive reported status on unknown ref: refs/for/main/topic 24 - To <URL/of/upstream.git> 25 - ! [remote rejected] HEAD -> refs/for/a/b/c/my/topic (proc-receive failed to report status) 17 + format_and_save_expect <<-EOF && 18 + > remote: # pre-receive hook Z 19 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic Z 20 + > remote: # proc-receive hook Z 21 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic Z 22 + > remote: proc-receive> ok refs/for/main/topic Z 23 + > remote: error: proc-receive reported status on unknown ref: refs/for/main/topic Z 24 + > To <URL/of/upstream.git> 25 + > ! [remote rejected] HEAD -> refs/for/a/b/c/my/topic (proc-receive failed to report status) 26 26 EOF 27 27 test_cmp expect actual && 28 28
+10 -10
t/t5411/test-0025-report-unknown-ref--porcelain.sh
··· 14 14 HEAD:refs/for/a/b/c/my/topic \ 15 15 >out-$test_count 2>&1 && 16 16 make_user_friendly_and_stable_output <out-$test_count >actual && 17 - cat >expect <<-EOF && 18 - remote: # pre-receive hook 19 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic 20 - remote: # proc-receive hook 21 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic 22 - remote: proc-receive> ok refs/for/main/topic 23 - remote: error: proc-receive reported status on unknown ref: refs/for/main/topic 24 - To <URL/of/upstream.git> 25 - ! HEAD:refs/for/a/b/c/my/topic [remote rejected] (proc-receive failed to report status) 26 - Done 17 + format_and_save_expect <<-EOF && 18 + > remote: # pre-receive hook Z 19 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic Z 20 + > remote: # proc-receive hook Z 21 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/my/topic Z 22 + > remote: proc-receive> ok refs/for/main/topic Z 23 + > remote: error: proc-receive reported status on unknown ref: refs/for/main/topic Z 24 + > To <URL/of/upstream.git> 25 + > ! HEAD:refs/for/a/b/c/my/topic [remote rejected] (proc-receive failed to report status) 26 + > Done 27 27 EOF 28 28 test_cmp expect actual && 29 29
+29 -29
t/t5411/test-0026-push-options.sh
··· 52 52 HEAD:refs/for/main/topic \ 53 53 >out 2>&1 && 54 54 make_user_friendly_and_stable_output <out >actual && 55 - cat >expect <<-EOF && 56 - remote: # pre-receive hook 57 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 58 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 59 - remote: # proc-receive hook 60 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 61 - remote: proc-receive> ok refs/for/main/topic 62 - remote: # post-receive hook 63 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 64 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 65 - To <URL/of/upstream.git> 66 - * [new branch] HEAD -> next 67 - * [new reference] HEAD -> refs/for/main/topic 55 + format_and_save_expect <<-EOF && 56 + > remote: # pre-receive hook Z 57 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 58 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 59 + > remote: # proc-receive hook Z 60 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 61 + > remote: proc-receive> ok refs/for/main/topic Z 62 + > remote: # post-receive hook Z 63 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 64 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 65 + > To <URL/of/upstream.git> 66 + > * [new branch] HEAD -> next 67 + > * [new reference] HEAD -> refs/for/main/topic 68 68 EOF 69 69 test_cmp expect actual && 70 70 ··· 101 101 HEAD:refs/for/main/topic \ 102 102 >out 2>&1 && 103 103 make_user_friendly_and_stable_output <out >actual && 104 - cat >expect <<-EOF && 105 - remote: # pre-receive hook 106 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 107 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 108 - remote: # proc-receive hook 109 - remote: proc-receive: atomic push_options 110 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 111 - remote: proc-receive< issue=123 112 - remote: proc-receive< reviewer=user1 113 - remote: proc-receive> ok refs/for/main/topic 114 - remote: # post-receive hook 115 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 116 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 117 - To <URL/of/upstream.git> 118 - * [new branch] HEAD -> next 119 - * [new reference] HEAD -> refs/for/main/topic 104 + format_and_save_expect <<-EOF && 105 + > remote: # pre-receive hook Z 106 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 107 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 108 + > remote: # proc-receive hook Z 109 + > remote: proc-receive: atomic push_options Z 110 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 111 + > remote: proc-receive< issue=123 Z 112 + > remote: proc-receive< reviewer=user1 Z 113 + > remote: proc-receive> ok refs/for/main/topic Z 114 + > remote: # post-receive hook Z 115 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 116 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 117 + > To <URL/of/upstream.git> 118 + > * [new branch] HEAD -> next 119 + > * [new reference] HEAD -> refs/for/main/topic 120 120 EOF 121 121 test_cmp expect actual && 122 122
+31 -31
t/t5411/test-0027-push-options--porcelain.sh
··· 54 54 HEAD:refs/for/main/topic \ 55 55 >out 2>&1 && 56 56 make_user_friendly_and_stable_output <out >actual && 57 - cat >expect <<-EOF && 58 - remote: # pre-receive hook 59 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 60 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 61 - remote: # proc-receive hook 62 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 63 - remote: proc-receive> ok refs/for/main/topic 64 - remote: # post-receive hook 65 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 66 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 67 - To <URL/of/upstream.git> 68 - * HEAD:refs/heads/next [new branch] 69 - * HEAD:refs/for/main/topic [new reference] 70 - Done 57 + format_and_save_expect <<-EOF && 58 + > remote: # pre-receive hook Z 59 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 60 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 61 + > remote: # proc-receive hook Z 62 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 63 + > remote: proc-receive> ok refs/for/main/topic Z 64 + > remote: # post-receive hook Z 65 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 66 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 67 + > To <URL/of/upstream.git> 68 + > * HEAD:refs/heads/next [new branch] 69 + > * HEAD:refs/for/main/topic [new reference] 70 + > Done 71 71 EOF 72 72 test_cmp expect actual && 73 73 ··· 105 105 HEAD:refs/for/main/topic \ 106 106 >out 2>&1 && 107 107 make_user_friendly_and_stable_output <out >actual && 108 - cat >expect <<-EOF && 109 - remote: # pre-receive hook 110 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 111 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 112 - remote: # proc-receive hook 113 - remote: proc-receive: atomic push_options 114 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 115 - remote: proc-receive< issue=123 116 - remote: proc-receive< reviewer=user1 117 - remote: proc-receive> ok refs/for/main/topic 118 - remote: # post-receive hook 119 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 120 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 121 - To <URL/of/upstream.git> 122 - * HEAD:refs/heads/next [new branch] 123 - * HEAD:refs/for/main/topic [new reference] 124 - Done 108 + format_and_save_expect <<-EOF && 109 + > remote: # pre-receive hook Z 110 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 111 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 112 + > remote: # proc-receive hook Z 113 + > remote: proc-receive: atomic push_options Z 114 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 115 + > remote: proc-receive< issue=123 Z 116 + > remote: proc-receive< reviewer=user1 Z 117 + > remote: proc-receive> ok refs/for/main/topic Z 118 + > remote: # post-receive hook Z 119 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 120 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 121 + > To <URL/of/upstream.git> 122 + > * HEAD:refs/heads/next [new branch] 123 + > * HEAD:refs/for/main/topic [new reference] 124 + > Done 125 125 EOF 126 126 test_cmp expect actual && 127 127
+10 -10
t/t5411/test-0030-report-ok.sh
··· 14 14 HEAD:refs/for/main/topic \ 15 15 >out 2>&1 && 16 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 - * [new reference] HEAD -> refs/for/main/topic 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 27 EOF 28 28 test_cmp expect actual && 29 29
+11 -11
t/t5411/test-0031-report-ok--porcelain.sh
··· 14 14 HEAD:refs/for/main/topic \ 15 15 >out 2>&1 && 16 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 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 + > * HEAD:refs/for/main/topic [new reference] 27 + > Done 28 28 EOF 29 29 test_cmp expect actual && 30 30
+93 -93
t/t5411/test-0032-report-with-options.sh
··· 15 15 HEAD:refs/for/main/topic \ 16 16 >out-$test_count 2>&1 && 17 17 make_user_friendly_and_stable_output <out-$test_count >actual && 18 - cat >expect <<-EOF && 19 - remote: # pre-receive hook 20 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 21 - remote: # proc-receive hook 22 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 23 - remote: proc-receive> option refname refs/pull/123/head 24 - remote: proc-receive> option old-oid <COMMIT-B> 25 - remote: error: proc-receive reported "option" without a matching "ok/ng" directive 26 - To <URL/of/upstream.git> 27 - ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 18 + format_and_save_expect <<-EOF && 19 + > remote: # pre-receive hook Z 20 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 21 + > remote: # proc-receive hook Z 22 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 23 + > remote: proc-receive> option refname refs/pull/123/head Z 24 + > remote: proc-receive> option old-oid <COMMIT-B> Z 25 + > remote: error: proc-receive reported "option" without a matching "ok/ng" directive Z 26 + > To <URL/of/upstream.git> 27 + > ! [remote rejected] HEAD -> refs/for/main/topic (proc-receive failed to report status) 28 28 EOF 29 29 test_cmp expect actual 30 30 ' ··· 46 46 HEAD:refs/for/main/topic \ 47 47 >out 2>&1 && 48 48 make_user_friendly_and_stable_output <out >actual && 49 - cat >expect <<-EOF && 50 - remote: # pre-receive hook 51 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 52 - remote: # proc-receive hook 53 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 54 - remote: proc-receive> ok refs/for/main/topic 55 - remote: proc-receive> option refname refs/pull/123/head 56 - remote: # post-receive hook 57 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head 58 - To <URL/of/upstream.git> 59 - * [new reference] HEAD -> refs/pull/123/head 49 + format_and_save_expect <<-EOF && 50 + > remote: # pre-receive hook Z 51 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 52 + > remote: # proc-receive hook Z 53 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 54 + > remote: proc-receive> ok refs/for/main/topic Z 55 + > remote: proc-receive> option refname refs/pull/123/head Z 56 + > remote: # post-receive hook Z 57 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head Z 58 + > To <URL/of/upstream.git> 59 + > * [new reference] HEAD -> refs/pull/123/head 60 60 EOF 61 61 test_cmp expect actual 62 62 ' ··· 78 78 HEAD:refs/for/main/topic \ 79 79 >out 2>&1 && 80 80 make_user_friendly_and_stable_output <out >actual && 81 - cat >expect <<-EOF && 82 - remote: # pre-receive hook 83 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 84 - remote: # proc-receive hook 85 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 86 - remote: proc-receive> ok refs/for/main/topic 87 - remote: proc-receive> option refname refs/pull/123/head 88 - remote: proc-receive> option forced-update 89 - remote: # post-receive hook 90 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head 91 - To <URL/of/upstream.git> 92 - * [new reference] HEAD -> refs/pull/123/head 81 + format_and_save_expect <<-EOF && 82 + > remote: # pre-receive hook Z 83 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 84 + > remote: # proc-receive hook Z 85 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 86 + > remote: proc-receive> ok refs/for/main/topic Z 87 + > remote: proc-receive> option refname refs/pull/123/head Z 88 + > remote: proc-receive> option forced-update Z 89 + > remote: # post-receive hook Z 90 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head Z 91 + > To <URL/of/upstream.git> 92 + > * [new reference] HEAD -> refs/pull/123/head 93 93 EOF 94 94 test_cmp expect actual 95 95 ' ··· 112 112 HEAD:refs/for/main/topic \ 113 113 >out 2>&1 && 114 114 make_user_friendly_and_stable_output <out >actual && 115 - cat >expect <<-EOF && 116 - remote: # pre-receive hook 117 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 118 - remote: # proc-receive hook 119 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 120 - remote: proc-receive> ok refs/for/main/topic 121 - remote: proc-receive> option refname refs/pull/123/head 122 - remote: proc-receive> option old-oid <COMMIT-B> 123 - remote: # post-receive hook 124 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/123/head 125 - To <URL/of/upstream.git> 126 - <OID-B>..<OID-A> HEAD -> refs/pull/123/head 115 + format_and_save_expect <<-EOF && 116 + > remote: # pre-receive hook Z 117 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 118 + > remote: # proc-receive hook Z 119 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 120 + > remote: proc-receive> ok refs/for/main/topic Z 121 + > remote: proc-receive> option refname refs/pull/123/head Z 122 + > remote: proc-receive> option old-oid <COMMIT-B> Z 123 + > remote: # post-receive hook Z 124 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/123/head Z 125 + > To <URL/of/upstream.git> 126 + > <OID-B>..<OID-A> HEAD -> refs/pull/123/head 127 127 EOF 128 128 test_cmp expect actual 129 129 ' ··· 145 145 HEAD:refs/for/main/topic \ 146 146 >out 2>&1 && 147 147 make_user_friendly_and_stable_output <out >actual && 148 - cat >expect <<-EOF && 149 - remote: # pre-receive hook 150 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 151 - remote: # proc-receive hook 152 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 153 - remote: proc-receive> ok refs/for/main/topic 154 - remote: proc-receive> option old-oid <COMMIT-B> 155 - remote: # post-receive hook 156 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic 157 - To <URL/of/upstream.git> 158 - <OID-B>..<OID-A> HEAD -> refs/for/main/topic 148 + format_and_save_expect <<-EOF && 149 + > remote: # pre-receive hook Z 150 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 151 + > remote: # proc-receive hook Z 152 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 153 + > remote: proc-receive> ok refs/for/main/topic Z 154 + > remote: proc-receive> option old-oid <COMMIT-B> Z 155 + > remote: # post-receive hook Z 156 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic Z 157 + > To <URL/of/upstream.git> 158 + > <OID-B>..<OID-A> HEAD -> refs/for/main/topic 159 159 EOF 160 160 test_cmp expect actual 161 161 ' ··· 178 178 HEAD:refs/for/main/topic \ 179 179 >out 2>&1 && 180 180 make_user_friendly_and_stable_output <out >actual && 181 - cat >expect <<-EOF && 182 - remote: # pre-receive hook 183 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 184 - remote: # proc-receive hook 185 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 186 - remote: proc-receive> ok refs/for/main/topic 187 - remote: proc-receive> option old-oid <COMMIT-A> 188 - remote: proc-receive> option new-oid <COMMIT-B> 189 - remote: # post-receive hook 190 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 191 - To <URL/of/upstream.git> 192 - <OID-A>..<OID-B> HEAD -> refs/for/main/topic 181 + format_and_save_expect <<-EOF && 182 + > remote: # pre-receive hook Z 183 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 184 + > remote: # proc-receive hook Z 185 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 186 + > remote: proc-receive> ok refs/for/main/topic Z 187 + > remote: proc-receive> option old-oid <COMMIT-A> Z 188 + > remote: proc-receive> option new-oid <COMMIT-B> Z 189 + > remote: # post-receive hook Z 190 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 191 + > To <URL/of/upstream.git> 192 + > <OID-A>..<OID-B> HEAD -> refs/for/main/topic 193 193 EOF 194 194 test_cmp expect actual 195 195 ' ··· 219 219 HEAD:refs/for/main/topic \ 220 220 >out 2>&1 && 221 221 make_user_friendly_and_stable_output <out >actual && 222 - cat >expect <<-EOF && 223 - remote: # pre-receive hook 224 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 225 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic 226 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 227 - remote: # proc-receive hook 228 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 229 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic 230 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 231 - remote: proc-receive> ok refs/for/a/b/c/topic 232 - remote: proc-receive> ok refs/for/next/topic 233 - remote: proc-receive> option refname refs/pull/123/head 234 - remote: proc-receive> ok refs/for/main/topic 235 - remote: proc-receive> option refname refs/pull/124/head 236 - remote: proc-receive> option old-oid <COMMIT-B> 237 - remote: proc-receive> option forced-update 238 - remote: proc-receive> option new-oid <COMMIT-A> 239 - remote: # post-receive hook 240 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head 241 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic 242 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head 243 - To <URL/of/upstream.git> 244 - * [new reference] HEAD -> refs/pull/123/head 245 - * [new reference] HEAD -> refs/for/a/b/c/topic 246 - + <OID-B>...<OID-A> HEAD -> refs/pull/124/head (forced update) 222 + format_and_save_expect <<-EOF && 223 + > remote: # pre-receive hook Z 224 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 225 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic Z 226 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 227 + > remote: # proc-receive hook Z 228 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 229 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic Z 230 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 231 + > remote: proc-receive> ok refs/for/a/b/c/topic Z 232 + > remote: proc-receive> ok refs/for/next/topic Z 233 + > remote: proc-receive> option refname refs/pull/123/head Z 234 + > remote: proc-receive> ok refs/for/main/topic Z 235 + > remote: proc-receive> option refname refs/pull/124/head Z 236 + > remote: proc-receive> option old-oid <COMMIT-B> Z 237 + > remote: proc-receive> option forced-update Z 238 + > remote: proc-receive> option new-oid <COMMIT-A> Z 239 + > remote: # post-receive hook Z 240 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head Z 241 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic Z 242 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head Z 243 + > To <URL/of/upstream.git> 244 + > * [new reference] HEAD -> refs/pull/123/head 245 + > * [new reference] HEAD -> refs/for/a/b/c/topic 246 + > + <OID-B>...<OID-A> HEAD -> refs/pull/124/head (forced update) 247 247 EOF 248 248 test_cmp expect actual && 249 249
+100 -100
t/t5411/test-0033-report-with-options--porcelain.sh
··· 15 15 HEAD:refs/for/main/topic \ 16 16 >out-$test_count 2>&1 && 17 17 make_user_friendly_and_stable_output <out-$test_count >actual && 18 - cat >expect <<-EOF && 19 - remote: # pre-receive hook 20 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 21 - remote: # proc-receive hook 22 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 23 - remote: proc-receive> option refname refs/pull/123/head 24 - remote: proc-receive> option old-oid <COMMIT-B> 25 - remote: error: proc-receive reported "option" without a matching "ok/ng" directive 26 - To <URL/of/upstream.git> 27 - ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 28 - Done 18 + format_and_save_expect <<-EOF && 19 + > remote: # pre-receive hook Z 20 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 21 + > remote: # proc-receive hook Z 22 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 23 + > remote: proc-receive> option refname refs/pull/123/head Z 24 + > remote: proc-receive> option old-oid <COMMIT-B> Z 25 + > remote: error: proc-receive reported "option" without a matching "ok/ng" directive Z 26 + > To <URL/of/upstream.git> 27 + > ! HEAD:refs/for/main/topic [remote rejected] (proc-receive failed to report status) 28 + > Done 29 29 EOF 30 30 test_cmp expect actual 31 31 ' ··· 47 47 HEAD:refs/for/main/topic \ 48 48 >out 2>&1 && 49 49 make_user_friendly_and_stable_output <out >actual && 50 - cat >expect <<-EOF && 51 - remote: # pre-receive hook 52 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 53 - remote: # proc-receive hook 54 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 55 - remote: proc-receive> ok refs/for/main/topic 56 - remote: proc-receive> option refname refs/pull/123/head 57 - remote: # post-receive hook 58 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head 59 - To <URL/of/upstream.git> 60 - * HEAD:refs/pull/123/head [new reference] 61 - Done 50 + format_and_save_expect <<-EOF && 51 + > remote: # pre-receive hook Z 52 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 53 + > remote: # proc-receive hook Z 54 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 55 + > remote: proc-receive> ok refs/for/main/topic Z 56 + > remote: proc-receive> option refname refs/pull/123/head Z 57 + > remote: # post-receive hook Z 58 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head Z 59 + > To <URL/of/upstream.git> 60 + > * HEAD:refs/pull/123/head [new reference] 61 + > Done 62 62 EOF 63 63 test_cmp expect actual 64 64 ' ··· 81 81 HEAD:refs/for/main/topic \ 82 82 >out 2>&1 && 83 83 make_user_friendly_and_stable_output <out >actual && 84 - cat >expect <<-EOF && 85 - remote: # pre-receive hook 86 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 87 - remote: # proc-receive hook 88 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 89 - remote: proc-receive> ok refs/for/main/topic 90 - remote: proc-receive> option refname refs/pull/123/head 91 - remote: proc-receive> option forced-update 92 - remote: # post-receive hook 93 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head 94 - To <URL/of/upstream.git> 95 - * HEAD:refs/pull/123/head [new reference] 96 - Done 84 + format_and_save_expect <<-EOF && 85 + > remote: # pre-receive hook Z 86 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 87 + > remote: # proc-receive hook Z 88 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 89 + > remote: proc-receive> ok refs/for/main/topic Z 90 + > remote: proc-receive> option refname refs/pull/123/head Z 91 + > remote: proc-receive> option forced-update Z 92 + > remote: # post-receive hook Z 93 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head Z 94 + > To <URL/of/upstream.git> 95 + > * HEAD:refs/pull/123/head [new reference] 96 + > Done 97 97 EOF 98 98 test_cmp expect actual 99 99 ' ··· 116 116 HEAD:refs/for/main/topic \ 117 117 >out 2>&1 && 118 118 make_user_friendly_and_stable_output <out >actual && 119 - cat >expect <<-EOF && 120 - remote: # pre-receive hook 121 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 122 - remote: # proc-receive hook 123 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 124 - remote: proc-receive> ok refs/for/main/topic 125 - remote: proc-receive> option refname refs/pull/123/head 126 - remote: proc-receive> option old-oid <COMMIT-B> 127 - remote: # post-receive hook 128 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/123/head 129 - To <URL/of/upstream.git> 130 - HEAD:refs/pull/123/head <OID-B>..<OID-A> 131 - Done 119 + format_and_save_expect <<-EOF && 120 + > remote: # pre-receive hook Z 121 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 122 + > remote: # proc-receive hook Z 123 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 124 + > remote: proc-receive> ok refs/for/main/topic Z 125 + > remote: proc-receive> option refname refs/pull/123/head Z 126 + > remote: proc-receive> option old-oid <COMMIT-B> Z 127 + > remote: # post-receive hook Z 128 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/123/head Z 129 + > To <URL/of/upstream.git> 130 + > HEAD:refs/pull/123/head <OID-B>..<OID-A> 131 + > Done 132 132 EOF 133 133 test_cmp expect actual 134 134 ' ··· 150 150 HEAD:refs/for/main/topic \ 151 151 >out 2>&1 && 152 152 make_user_friendly_and_stable_output <out >actual && 153 - cat >expect <<-EOF && 154 - remote: # pre-receive hook 155 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 156 - remote: # proc-receive hook 157 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 158 - remote: proc-receive> ok refs/for/main/topic 159 - remote: proc-receive> option old-oid <COMMIT-B> 160 - remote: # post-receive hook 161 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic 162 - To <URL/of/upstream.git> 163 - HEAD:refs/for/main/topic <OID-B>..<OID-A> 164 - Done 153 + format_and_save_expect <<-EOF && 154 + > remote: # pre-receive hook Z 155 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 156 + > remote: # proc-receive hook Z 157 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 158 + > remote: proc-receive> ok refs/for/main/topic Z 159 + > remote: proc-receive> option old-oid <COMMIT-B> Z 160 + > remote: # post-receive hook Z 161 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/for/main/topic Z 162 + > To <URL/of/upstream.git> 163 + > HEAD:refs/for/main/topic <OID-B>..<OID-A> 164 + > Done 165 165 EOF 166 166 test_cmp expect actual 167 167 ' ··· 184 184 HEAD:refs/for/main/topic \ 185 185 >out 2>&1 && 186 186 make_user_friendly_and_stable_output <out >actual && 187 - cat >expect <<-EOF && 188 - remote: # pre-receive hook 189 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 190 - remote: # proc-receive hook 191 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 192 - remote: proc-receive> ok refs/for/main/topic 193 - remote: proc-receive> option old-oid <COMMIT-A> 194 - remote: proc-receive> option new-oid <COMMIT-B> 195 - remote: # post-receive hook 196 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 197 - To <URL/of/upstream.git> 198 - HEAD:refs/for/main/topic <OID-A>..<OID-B> 199 - Done 187 + format_and_save_expect <<-EOF && 188 + > remote: # pre-receive hook Z 189 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 190 + > remote: # proc-receive hook Z 191 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 192 + > remote: proc-receive> ok refs/for/main/topic Z 193 + > remote: proc-receive> option old-oid <COMMIT-A> Z 194 + > remote: proc-receive> option new-oid <COMMIT-B> Z 195 + > remote: # post-receive hook Z 196 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 197 + > To <URL/of/upstream.git> 198 + > HEAD:refs/for/main/topic <OID-A>..<OID-B> 199 + > Done 200 200 EOF 201 201 test_cmp expect actual 202 202 ' ··· 227 227 HEAD:refs/for/main/topic \ 228 228 >out 2>&1 && 229 229 make_user_friendly_and_stable_output <out >actual && 230 - cat >expect <<-EOF && 231 - remote: # pre-receive hook 232 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 233 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic 234 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 235 - remote: # proc-receive hook 236 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 237 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic 238 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 239 - remote: proc-receive> ok refs/for/a/b/c/topic 240 - remote: proc-receive> ok refs/for/next/topic 241 - remote: proc-receive> option refname refs/pull/123/head 242 - remote: proc-receive> ok refs/for/main/topic 243 - remote: proc-receive> option refname refs/pull/124/head 244 - remote: proc-receive> option old-oid <COMMIT-B> 245 - remote: proc-receive> option forced-update 246 - remote: proc-receive> option new-oid <COMMIT-A> 247 - remote: # post-receive hook 248 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head 249 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic 250 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head 251 - To <URL/of/upstream.git> 252 - * HEAD:refs/pull/123/head [new reference] 253 - * HEAD:refs/for/a/b/c/topic [new reference] 254 - + HEAD:refs/pull/124/head <OID-B>...<OID-A> (forced update) 255 - Done 230 + format_and_save_expect <<-EOF && 231 + > remote: # pre-receive hook Z 232 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 233 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic Z 234 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 235 + > remote: # proc-receive hook Z 236 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 237 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic Z 238 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 239 + > remote: proc-receive> ok refs/for/a/b/c/topic Z 240 + > remote: proc-receive> ok refs/for/next/topic Z 241 + > remote: proc-receive> option refname refs/pull/123/head Z 242 + > remote: proc-receive> ok refs/for/main/topic Z 243 + > remote: proc-receive> option refname refs/pull/124/head Z 244 + > remote: proc-receive> option old-oid <COMMIT-B> Z 245 + > remote: proc-receive> option forced-update Z 246 + > remote: proc-receive> option new-oid <COMMIT-A> Z 247 + > remote: # post-receive hook Z 248 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/123/head Z 249 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/a/b/c/topic Z 250 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head Z 251 + > To <URL/of/upstream.git> 252 + > * HEAD:refs/pull/123/head [new reference] 253 + > * HEAD:refs/for/a/b/c/topic [new reference] 254 + > + HEAD:refs/pull/124/head <OID-B>...<OID-A> (forced update) 255 + > Done 256 256 EOF 257 257 test_cmp expect actual && 258 258
+11 -11
t/t5411/test-0034-report-ft.sh
··· 15 15 $B:refs/for/main/topic \ 16 16 >out 2>&1 && 17 17 make_user_friendly_and_stable_output <out >actual && 18 - cat >expect <<-EOF && 19 - remote: # pre-receive hook 20 - remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic 21 - remote: # proc-receive hook 22 - remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic 23 - remote: proc-receive> ok refs/for/main/topic 24 - remote: proc-receive> option fall-through 25 - remote: # post-receive hook 26 - remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic 27 - To <URL/of/upstream.git> 28 - * [new reference] <COMMIT-B> -> refs/for/main/topic 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 29 29 EOF 30 30 test_cmp expect actual && 31 31
+12 -12
t/t5411/test-0035-report-ft--porcelain.sh
··· 15 15 $B:refs/for/main/topic \ 16 16 >out 2>&1 && 17 17 make_user_friendly_and_stable_output <out >actual && 18 - cat >expect <<-EOF && 19 - remote: # pre-receive hook 20 - remote: pre-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic 21 - remote: # proc-receive hook 22 - remote: proc-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic 23 - remote: proc-receive> ok refs/for/main/topic 24 - remote: proc-receive> option fall-through 25 - remote: # post-receive hook 26 - remote: post-receive< <ZERO-OID> <COMMIT-B> refs/for/main/topic 27 - To <URL/of/upstream.git> 28 - * <COMMIT-B>:refs/for/main/topic [new reference] 29 - Done 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 + > * <COMMIT-B>:refs/for/main/topic [new reference] 29 + > Done 30 30 EOF 31 31 test_cmp expect actual && 32 32
+66 -66
t/t5411/test-0036-report-multi-rewrite-for-one-ref.sh
··· 39 39 HEAD:refs/for/main/topic \ 40 40 >out 2>&1 && 41 41 make_user_friendly_and_stable_output <out >actual && 42 - cat >expect <<-EOF && 43 - remote: # pre-receive hook 44 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 45 - remote: # proc-receive hook 46 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 47 - remote: proc-receive> ok refs/for/main/topic 48 - remote: proc-receive> option old-oid <COMMIT-A> 49 - remote: proc-receive> option new-oid <COMMIT-B> 50 - remote: proc-receive> ok refs/for/main/topic 51 - remote: proc-receive> option refname refs/changes/24/124/1 52 - remote: proc-receive> option old-oid <ZERO-OID> 53 - remote: proc-receive> option new-oid <COMMIT-A> 54 - remote: proc-receive> ok refs/for/main/topic 55 - remote: proc-receive> option refname refs/changes/25/125/1 56 - remote: proc-receive> option old-oid <COMMIT-A> 57 - remote: proc-receive> option new-oid <COMMIT-B> 58 - remote: # post-receive hook 59 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 60 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 61 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1 62 - To <URL/of/upstream.git> 63 - <OID-A>..<OID-B> HEAD -> refs/for/main/topic 64 - * [new reference] HEAD -> refs/changes/24/124/1 65 - <OID-A>..<OID-B> HEAD -> refs/changes/25/125/1 42 + format_and_save_expect <<-EOF && 43 + > remote: # pre-receive hook Z 44 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 45 + > remote: # proc-receive hook Z 46 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 47 + > remote: proc-receive> ok refs/for/main/topic Z 48 + > remote: proc-receive> option old-oid <COMMIT-A> Z 49 + > remote: proc-receive> option new-oid <COMMIT-B> Z 50 + > remote: proc-receive> ok refs/for/main/topic Z 51 + > remote: proc-receive> option refname refs/changes/24/124/1 Z 52 + > remote: proc-receive> option old-oid <ZERO-OID> Z 53 + > remote: proc-receive> option new-oid <COMMIT-A> Z 54 + > remote: proc-receive> ok refs/for/main/topic Z 55 + > remote: proc-receive> option refname refs/changes/25/125/1 Z 56 + > remote: proc-receive> option old-oid <COMMIT-A> Z 57 + > remote: proc-receive> option new-oid <COMMIT-B> Z 58 + > remote: # post-receive hook Z 59 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 60 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 Z 61 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1 Z 62 + > To <URL/of/upstream.git> 63 + > <OID-A>..<OID-B> HEAD -> refs/for/main/topic 64 + > * [new reference] HEAD -> refs/changes/24/124/1 65 + > <OID-A>..<OID-B> HEAD -> refs/changes/25/125/1 66 66 EOF 67 67 test_cmp expect actual && 68 68 ··· 113 113 HEAD:refs/for/main/topic \ 114 114 >out 2>&1 && 115 115 make_user_friendly_and_stable_output <out >actual && 116 - cat >expect <<-EOF && 117 - remote: # pre-receive hook 118 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 119 - remote: # proc-receive hook 120 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 121 - remote: proc-receive> ok refs/for/main/topic 122 - remote: proc-receive> option refname refs/changes/24/124/1 123 - remote: proc-receive> option old-oid <ZERO-OID> 124 - remote: proc-receive> option new-oid <COMMIT-A> 125 - remote: proc-receive> ok refs/for/main/topic 126 - remote: proc-receive> option old-oid <COMMIT-A> 127 - remote: proc-receive> option new-oid <COMMIT-B> 128 - remote: proc-receive> ok refs/for/main/topic 129 - remote: proc-receive> option refname refs/changes/25/125/1 130 - remote: proc-receive> option old-oid <COMMIT-B> 131 - remote: proc-receive> option new-oid <COMMIT-A> 132 - remote: proc-receive> option forced-update 133 - remote: # post-receive hook 134 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 135 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 136 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1 137 - To <URL/of/upstream.git> 138 - * [new reference] HEAD -> refs/changes/24/124/1 139 - <OID-A>..<OID-B> HEAD -> refs/for/main/topic 140 - + <OID-B>...<OID-A> HEAD -> refs/changes/25/125/1 (forced update) 116 + format_and_save_expect <<-EOF && 117 + > remote: # pre-receive hook Z 118 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 119 + > remote: # proc-receive hook Z 120 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 121 + > remote: proc-receive> ok refs/for/main/topic Z 122 + > remote: proc-receive> option refname refs/changes/24/124/1 Z 123 + > remote: proc-receive> option old-oid <ZERO-OID> Z 124 + > remote: proc-receive> option new-oid <COMMIT-A> Z 125 + > remote: proc-receive> ok refs/for/main/topic Z 126 + > remote: proc-receive> option old-oid <COMMIT-A> Z 127 + > remote: proc-receive> option new-oid <COMMIT-B> Z 128 + > remote: proc-receive> ok refs/for/main/topic Z 129 + > remote: proc-receive> option refname refs/changes/25/125/1 Z 130 + > remote: proc-receive> option old-oid <COMMIT-B> Z 131 + > remote: proc-receive> option new-oid <COMMIT-A> Z 132 + > remote: proc-receive> option forced-update Z 133 + > remote: # post-receive hook Z 134 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 Z 135 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 136 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1 Z 137 + > To <URL/of/upstream.git> 138 + > * [new reference] HEAD -> refs/changes/24/124/1 139 + > <OID-A>..<OID-B> HEAD -> refs/for/main/topic 140 + > + <OID-B>...<OID-A> HEAD -> refs/changes/25/125/1 (forced update) 141 141 EOF 142 142 test_cmp expect actual && 143 143 ··· 182 182 HEAD:refs/for/main/topic \ 183 183 >out 2>&1 && 184 184 make_user_friendly_and_stable_output <out >actual && 185 - cat >expect <<-EOF && 186 - remote: # pre-receive hook 187 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 188 - remote: # proc-receive hook 189 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 190 - remote: proc-receive> ok refs/for/main/topic 191 - remote: proc-receive> option refname refs/changes/23/123/1 192 - remote: proc-receive> ok refs/for/main/topic 193 - remote: proc-receive> option refname refs/changes/24/124/2 194 - remote: proc-receive> option old-oid <COMMIT-A> 195 - remote: proc-receive> option new-oid <COMMIT-B> 196 - remote: # post-receive hook 197 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/23/123/1 198 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/24/124/2 199 - To <URL/of/upstream.git> 200 - * [new reference] HEAD -> refs/changes/23/123/1 201 - <OID-A>..<OID-B> HEAD -> refs/changes/24/124/2 185 + format_and_save_expect <<-EOF && 186 + > remote: # pre-receive hook Z 187 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 188 + > remote: # proc-receive hook Z 189 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 190 + > remote: proc-receive> ok refs/for/main/topic Z 191 + > remote: proc-receive> option refname refs/changes/23/123/1 Z 192 + > remote: proc-receive> ok refs/for/main/topic Z 193 + > remote: proc-receive> option refname refs/changes/24/124/2 Z 194 + > remote: proc-receive> option old-oid <COMMIT-A> Z 195 + > remote: proc-receive> option new-oid <COMMIT-B> Z 196 + > remote: # post-receive hook Z 197 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/23/123/1 Z 198 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/24/124/2 Z 199 + > To <URL/of/upstream.git> 200 + > * [new reference] HEAD -> refs/changes/23/123/1 201 + > <OID-A>..<OID-B> HEAD -> refs/changes/24/124/2 202 202 EOF 203 203 test_cmp expect actual && 204 204
+69 -69
t/t5411/test-0037-report-multi-rewrite-for-one-ref--porcelain.sh
··· 24 24 HEAD:refs/for/main/topic \ 25 25 >out 2>&1 && 26 26 make_user_friendly_and_stable_output <out >actual && 27 - cat >expect <<-EOF && 28 - remote: # pre-receive hook 29 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 30 - remote: # proc-receive hook 31 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 32 - remote: proc-receive> ok refs/for/main/topic 33 - remote: proc-receive> option old-oid <COMMIT-A> 34 - remote: proc-receive> option new-oid <COMMIT-B> 35 - remote: proc-receive> ok refs/for/main/topic 36 - remote: proc-receive> option refname refs/changes/24/124/1 37 - remote: proc-receive> option old-oid <ZERO-OID> 38 - remote: proc-receive> option new-oid <COMMIT-A> 39 - remote: proc-receive> ok refs/for/main/topic 40 - remote: proc-receive> option refname refs/changes/25/125/1 41 - remote: proc-receive> option old-oid <COMMIT-A> 42 - remote: proc-receive> option new-oid <COMMIT-B> 43 - remote: # post-receive hook 44 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 45 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 46 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1 47 - To <URL/of/upstream.git> 48 - HEAD:refs/for/main/topic <OID-A>..<OID-B> 49 - * HEAD:refs/changes/24/124/1 [new reference] 50 - HEAD:refs/changes/25/125/1 <OID-A>..<OID-B> 51 - Done 27 + format_and_save_expect <<-EOF && 28 + > remote: # pre-receive hook Z 29 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 30 + > remote: # proc-receive hook Z 31 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 32 + > remote: proc-receive> ok refs/for/main/topic Z 33 + > remote: proc-receive> option old-oid <COMMIT-A> Z 34 + > remote: proc-receive> option new-oid <COMMIT-B> Z 35 + > remote: proc-receive> ok refs/for/main/topic Z 36 + > remote: proc-receive> option refname refs/changes/24/124/1 Z 37 + > remote: proc-receive> option old-oid <ZERO-OID> Z 38 + > remote: proc-receive> option new-oid <COMMIT-A> Z 39 + > remote: proc-receive> ok refs/for/main/topic Z 40 + > remote: proc-receive> option refname refs/changes/25/125/1 Z 41 + > remote: proc-receive> option old-oid <COMMIT-A> Z 42 + > remote: proc-receive> option new-oid <COMMIT-B> Z 43 + > remote: # post-receive hook Z 44 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 45 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 Z 46 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/25/125/1 Z 47 + > To <URL/of/upstream.git> 48 + > HEAD:refs/for/main/topic <OID-A>..<OID-B> 49 + > * HEAD:refs/changes/24/124/1 [new reference] 50 + > HEAD:refs/changes/25/125/1 <OID-A>..<OID-B> 51 + > Done 52 52 EOF 53 53 test_cmp expect actual && 54 54 ··· 84 84 HEAD:refs/for/main/topic \ 85 85 >out 2>&1 && 86 86 make_user_friendly_and_stable_output <out >actual && 87 - cat >expect <<-EOF && 88 - remote: # pre-receive hook 89 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 90 - remote: # proc-receive hook 91 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 92 - remote: proc-receive> ok refs/for/main/topic 93 - remote: proc-receive> option refname refs/changes/24/124/1 94 - remote: proc-receive> option old-oid <ZERO-OID> 95 - remote: proc-receive> option new-oid <COMMIT-A> 96 - remote: proc-receive> ok refs/for/main/topic 97 - remote: proc-receive> option old-oid <COMMIT-A> 98 - remote: proc-receive> option new-oid <COMMIT-B> 99 - remote: proc-receive> ok refs/for/main/topic 100 - remote: proc-receive> option refname refs/changes/25/125/1 101 - remote: proc-receive> option old-oid <COMMIT-B> 102 - remote: proc-receive> option new-oid <COMMIT-A> 103 - remote: proc-receive> option forced-update 104 - remote: # post-receive hook 105 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 106 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 107 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1 108 - To <URL/of/upstream.git> 109 - * HEAD:refs/changes/24/124/1 [new reference] 110 - HEAD:refs/for/main/topic <OID-A>..<OID-B> 111 - + HEAD:refs/changes/25/125/1 <OID-B>...<OID-A> (forced update) 112 - Done 87 + format_and_save_expect <<-EOF && 88 + > remote: # pre-receive hook Z 89 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 90 + > remote: # proc-receive hook Z 91 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 92 + > remote: proc-receive> ok refs/for/main/topic Z 93 + > remote: proc-receive> option refname refs/changes/24/124/1 Z 94 + > remote: proc-receive> option old-oid <ZERO-OID> Z 95 + > remote: proc-receive> option new-oid <COMMIT-A> Z 96 + > remote: proc-receive> ok refs/for/main/topic Z 97 + > remote: proc-receive> option old-oid <COMMIT-A> Z 98 + > remote: proc-receive> option new-oid <COMMIT-B> Z 99 + > remote: proc-receive> ok refs/for/main/topic Z 100 + > remote: proc-receive> option refname refs/changes/25/125/1 Z 101 + > remote: proc-receive> option old-oid <COMMIT-B> Z 102 + > remote: proc-receive> option new-oid <COMMIT-A> Z 103 + > remote: proc-receive> option forced-update Z 104 + > remote: # post-receive hook Z 105 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/24/124/1 Z 106 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 107 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/changes/25/125/1 Z 108 + > To <URL/of/upstream.git> 109 + > * HEAD:refs/changes/24/124/1 [new reference] 110 + > HEAD:refs/for/main/topic <OID-A>..<OID-B> 111 + > + HEAD:refs/changes/25/125/1 <OID-B>...<OID-A> (forced update) 112 + > Done 113 113 EOF 114 114 test_cmp expect actual && 115 115 ··· 139 139 HEAD:refs/for/main/topic \ 140 140 >out 2>&1 && 141 141 make_user_friendly_and_stable_output <out >actual && 142 - cat >expect <<-EOF && 143 - remote: # pre-receive hook 144 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 145 - remote: # proc-receive hook 146 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 147 - remote: proc-receive> ok refs/for/main/topic 148 - remote: proc-receive> option refname refs/changes/23/123/1 149 - remote: proc-receive> ok refs/for/main/topic 150 - remote: proc-receive> option refname refs/changes/24/124/2 151 - remote: proc-receive> option old-oid <COMMIT-A> 152 - remote: proc-receive> option new-oid <COMMIT-B> 153 - remote: # post-receive hook 154 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/23/123/1 155 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/24/124/2 156 - To <URL/of/upstream.git> 157 - * HEAD:refs/changes/23/123/1 [new reference] 158 - HEAD:refs/changes/24/124/2 <OID-A>..<OID-B> 159 - Done 142 + format_and_save_expect <<-EOF && 143 + > remote: # pre-receive hook Z 144 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 145 + > remote: # proc-receive hook Z 146 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 147 + > remote: proc-receive> ok refs/for/main/topic Z 148 + > remote: proc-receive> option refname refs/changes/23/123/1 Z 149 + > remote: proc-receive> ok refs/for/main/topic Z 150 + > remote: proc-receive> option refname refs/changes/24/124/2 Z 151 + > remote: proc-receive> option old-oid <COMMIT-A> Z 152 + > remote: proc-receive> option new-oid <COMMIT-B> Z 153 + > remote: # post-receive hook Z 154 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/changes/23/123/1 Z 155 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/changes/24/124/2 Z 156 + > To <URL/of/upstream.git> 157 + > * HEAD:refs/changes/23/123/1 [new reference] 158 + > HEAD:refs/changes/24/124/2 <OID-A>..<OID-B> 159 + > Done 160 160 EOF 161 161 test_cmp expect actual && 162 162
+37 -37
t/t5411/test-0038-report-mixed-refs.sh
··· 26 26 HEAD:refs/for/next/topic3 \ 27 27 >out-$test_count 2>&1 && 28 28 make_user_friendly_and_stable_output <out-$test_count >actual && 29 - cat >expect <<-EOF && 30 - remote: # pre-receive hook 31 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 32 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar 33 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz 34 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 35 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 36 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo 37 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 38 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 39 - remote: # proc-receive hook 40 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 41 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 42 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 43 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 44 - remote: proc-receive> ok refs/for/next/topic2 45 - remote: proc-receive> ng refs/for/next/topic1 fail to call Web API 46 - remote: proc-receive> ok refs/for/main/topic 47 - remote: proc-receive> option refname refs/for/main/topic 48 - remote: proc-receive> option old-oid <COMMIT-A> 49 - remote: proc-receive> option new-oid <COMMIT-B> 50 - remote: # post-receive hook 51 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 52 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar 53 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz 54 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 55 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo 56 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 57 - To <URL/of/upstream.git> 58 - <OID-A>..<OID-B> <COMMIT-B> -> main 59 - * [new branch] HEAD -> bar 60 - * [new branch] HEAD -> baz 61 - * [new reference] HEAD -> refs/for/next/topic2 62 - * [new branch] HEAD -> foo 63 - <OID-A>..<OID-B> HEAD -> refs/for/main/topic 64 - ! [remote rejected] HEAD -> refs/for/next/topic1 (fail to call Web API) 65 - ! [remote rejected] HEAD -> refs/for/next/topic3 (proc-receive failed to report status) 29 + format_and_save_expect <<-EOF && 30 + > remote: # pre-receive hook Z 31 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 32 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar Z 33 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz Z 34 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 Z 35 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 Z 36 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo Z 37 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 38 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 Z 39 + > remote: # proc-receive hook Z 40 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 Z 41 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 Z 42 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 43 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 Z 44 + > remote: proc-receive> ok refs/for/next/topic2 Z 45 + > remote: proc-receive> ng refs/for/next/topic1 fail to call Web API Z 46 + > remote: proc-receive> ok refs/for/main/topic Z 47 + > remote: proc-receive> option refname refs/for/main/topic Z 48 + > remote: proc-receive> option old-oid <COMMIT-A> Z 49 + > remote: proc-receive> option new-oid <COMMIT-B> Z 50 + > remote: # post-receive hook Z 51 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 52 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar Z 53 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz Z 54 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 Z 55 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo Z 56 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 57 + > To <URL/of/upstream.git> 58 + > <OID-A>..<OID-B> <COMMIT-B> -> main 59 + > * [new branch] HEAD -> bar 60 + > * [new branch] HEAD -> baz 61 + > * [new reference] HEAD -> refs/for/next/topic2 62 + > * [new branch] HEAD -> foo 63 + > <OID-A>..<OID-B> HEAD -> refs/for/main/topic 64 + > ! [remote rejected] HEAD -> refs/for/next/topic1 (fail to call Web API) 65 + > ! [remote rejected] HEAD -> refs/for/next/topic3 (proc-receive failed to report status) 66 66 EOF 67 67 test_cmp expect actual && 68 68
+38 -38
t/t5411/test-0039-report-mixed-refs--porcelain.sh
··· 26 26 HEAD:refs/for/next/topic3 \ 27 27 >out-$test_count 2>&1 && 28 28 make_user_friendly_and_stable_output <out-$test_count >actual && 29 - cat >expect <<-EOF && 30 - remote: # pre-receive hook 31 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 32 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar 33 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz 34 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 35 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 36 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo 37 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 38 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 39 - remote: # proc-receive hook 40 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 41 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 42 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 43 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 44 - remote: proc-receive> ok refs/for/next/topic2 45 - remote: proc-receive> ng refs/for/next/topic1 fail to call Web API 46 - remote: proc-receive> ok refs/for/main/topic 47 - remote: proc-receive> option refname refs/for/main/topic 48 - remote: proc-receive> option old-oid <COMMIT-A> 49 - remote: proc-receive> option new-oid <COMMIT-B> 50 - remote: # post-receive hook 51 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 52 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar 53 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz 54 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 55 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo 56 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic 57 - To <URL/of/upstream.git> 58 - <COMMIT-B>:refs/heads/main <OID-A>..<OID-B> 59 - * HEAD:refs/heads/bar [new branch] 60 - * HEAD:refs/heads/baz [new branch] 61 - * HEAD:refs/for/next/topic2 [new reference] 62 - * HEAD:refs/heads/foo [new branch] 63 - HEAD:refs/for/main/topic <OID-A>..<OID-B> 64 - ! HEAD:refs/for/next/topic1 [remote rejected] (fail to call Web API) 65 - ! HEAD:refs/for/next/topic3 [remote rejected] (proc-receive failed to report status) 66 - Done 29 + format_and_save_expect <<-EOF && 30 + > remote: # pre-receive hook Z 31 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 32 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar Z 33 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz Z 34 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 Z 35 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 Z 36 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo Z 37 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 38 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 Z 39 + > remote: # proc-receive hook Z 40 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 Z 41 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic1 Z 42 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 43 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic3 Z 44 + > remote: proc-receive> ok refs/for/next/topic2 Z 45 + > remote: proc-receive> ng refs/for/next/topic1 fail to call Web API Z 46 + > remote: proc-receive> ok refs/for/main/topic Z 47 + > remote: proc-receive> option refname refs/for/main/topic Z 48 + > remote: proc-receive> option old-oid <COMMIT-A> Z 49 + > remote: proc-receive> option new-oid <COMMIT-B> Z 50 + > remote: # post-receive hook Z 51 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 52 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/bar Z 53 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/baz Z 54 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic2 Z 55 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/heads/foo Z 56 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/for/main/topic Z 57 + > To <URL/of/upstream.git> 58 + > <COMMIT-B>:refs/heads/main <OID-A>..<OID-B> 59 + > * HEAD:refs/heads/bar [new branch] 60 + > * HEAD:refs/heads/baz [new branch] 61 + > * HEAD:refs/for/next/topic2 [new reference] 62 + > * HEAD:refs/heads/foo [new branch] 63 + > HEAD:refs/for/main/topic <OID-A>..<OID-B> 64 + > ! HEAD:refs/for/next/topic1 [remote rejected] (fail to call Web API) 65 + > ! HEAD:refs/for/next/topic3 [remote rejected] (proc-receive failed to report status) 66 + > Done 67 67 EOF 68 68 test_cmp expect actual && 69 69
+40 -40
t/t5411/test-0040-process-all-refs.sh
··· 50 50 HEAD:refs/for/next/topic \ 51 51 >out 2>&1 && 52 52 make_user_friendly_and_stable_output <out >actual && 53 - cat >expect <<-EOF && 54 - remote: # pre-receive hook 55 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar 56 - remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo 57 - remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 58 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 59 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 60 - remote: # proc-receive hook 61 - remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar 62 - remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo 63 - remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 64 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 65 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 66 - remote: proc-receive> ok refs/heads/main 67 - remote: proc-receive> option fall-through 68 - remote: proc-receive> ok refs/heads/foo 69 - remote: proc-receive> option fall-through 70 - remote: proc-receive> ok refs/heads/bar 71 - remote: proc-receive> option fall-through 72 - remote: proc-receive> ok refs/for/main/topic 73 - remote: proc-receive> option refname refs/pull/123/head 74 - remote: proc-receive> option old-oid <COMMIT-A> 75 - remote: proc-receive> option new-oid <COMMIT-B> 76 - remote: proc-receive> ok refs/for/next/topic 77 - remote: proc-receive> option refname refs/pull/124/head 78 - remote: proc-receive> option old-oid <COMMIT-B> 79 - remote: proc-receive> option new-oid <COMMIT-A> 80 - remote: proc-receive> option forced-update 81 - remote: # post-receive hook 82 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar 83 - remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo 84 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 85 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head 86 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head 87 - To <URL/of/upstream.git> 88 - <OID-A>..<OID-B> <COMMIT-B> -> bar 89 - - [deleted] foo 90 - + <OID-B>...<OID-A> HEAD -> main (forced update) 91 - <OID-A>..<OID-B> HEAD -> refs/pull/123/head 92 - + <OID-B>...<OID-A> HEAD -> refs/pull/124/head (forced update) 53 + format_and_save_expect <<-EOF && 54 + > remote: # pre-receive hook Z 55 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar Z 56 + > remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo Z 57 + > remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 58 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 59 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 60 + > remote: # proc-receive hook Z 61 + > remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar Z 62 + > remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo Z 63 + > remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 64 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 65 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 66 + > remote: proc-receive> ok refs/heads/main Z 67 + > remote: proc-receive> option fall-through Z 68 + > remote: proc-receive> ok refs/heads/foo Z 69 + > remote: proc-receive> option fall-through Z 70 + > remote: proc-receive> ok refs/heads/bar Z 71 + > remote: proc-receive> option fall-through Z 72 + > remote: proc-receive> ok refs/for/main/topic Z 73 + > remote: proc-receive> option refname refs/pull/123/head Z 74 + > remote: proc-receive> option old-oid <COMMIT-A> Z 75 + > remote: proc-receive> option new-oid <COMMIT-B> Z 76 + > remote: proc-receive> ok refs/for/next/topic Z 77 + > remote: proc-receive> option refname refs/pull/124/head Z 78 + > remote: proc-receive> option old-oid <COMMIT-B> Z 79 + > remote: proc-receive> option new-oid <COMMIT-A> Z 80 + > remote: proc-receive> option forced-update Z 81 + > remote: # post-receive hook Z 82 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar Z 83 + > remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo Z 84 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 85 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head Z 86 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head Z 87 + > To <URL/of/upstream.git> 88 + > <OID-A>..<OID-B> <COMMIT-B> -> bar 89 + > - [deleted] foo 90 + > + <OID-B>...<OID-A> HEAD -> main (forced update) 91 + > <OID-A>..<OID-B> HEAD -> refs/pull/123/head 92 + > + <OID-B>...<OID-A> HEAD -> refs/pull/124/head (forced update) 93 93 EOF 94 94 test_cmp expect actual && 95 95
+41 -41
t/t5411/test-0041-process-all-refs--porcelain.sh
··· 50 50 HEAD:refs/for/next/topic \ 51 51 >out 2>&1 && 52 52 make_user_friendly_and_stable_output <out >actual && 53 - cat >expect <<-EOF && 54 - remote: # pre-receive hook 55 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar 56 - remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo 57 - remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 58 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 59 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 60 - remote: # proc-receive hook 61 - remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar 62 - remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo 63 - remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 64 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic 65 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic 66 - remote: proc-receive> ok refs/heads/main 67 - remote: proc-receive> option fall-through 68 - remote: proc-receive> ok refs/heads/foo 69 - remote: proc-receive> option fall-through 70 - remote: proc-receive> ok refs/heads/bar 71 - remote: proc-receive> option fall-through 72 - remote: proc-receive> ok refs/for/main/topic 73 - remote: proc-receive> option refname refs/pull/123/head 74 - remote: proc-receive> option old-oid <COMMIT-A> 75 - remote: proc-receive> option new-oid <COMMIT-B> 76 - remote: proc-receive> ok refs/for/next/topic 77 - remote: proc-receive> option refname refs/pull/124/head 78 - remote: proc-receive> option old-oid <COMMIT-B> 79 - remote: proc-receive> option new-oid <COMMIT-A> 80 - remote: proc-receive> option forced-update 81 - remote: # post-receive hook 82 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar 83 - remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo 84 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main 85 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head 86 - remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head 87 - To <URL/of/upstream.git> 88 - <COMMIT-B>:refs/heads/bar <OID-A>..<OID-B> 89 - - :refs/heads/foo [deleted] 90 - + HEAD:refs/heads/main <OID-B>...<OID-A> (forced update) 91 - HEAD:refs/pull/123/head <OID-A>..<OID-B> 92 - + HEAD:refs/pull/124/head <OID-B>...<OID-A> (forced update) 93 - Done 53 + format_and_save_expect <<-EOF && 54 + > remote: # pre-receive hook Z 55 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar Z 56 + > remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo Z 57 + > remote: pre-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 58 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 59 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 60 + > remote: # proc-receive hook Z 61 + > remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar Z 62 + > remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo Z 63 + > remote: proc-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 64 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/main/topic Z 65 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/for/next/topic Z 66 + > remote: proc-receive> ok refs/heads/main Z 67 + > remote: proc-receive> option fall-through Z 68 + > remote: proc-receive> ok refs/heads/foo Z 69 + > remote: proc-receive> option fall-through Z 70 + > remote: proc-receive> ok refs/heads/bar Z 71 + > remote: proc-receive> option fall-through Z 72 + > remote: proc-receive> ok refs/for/main/topic Z 73 + > remote: proc-receive> option refname refs/pull/123/head Z 74 + > remote: proc-receive> option old-oid <COMMIT-A> Z 75 + > remote: proc-receive> option new-oid <COMMIT-B> Z 76 + > remote: proc-receive> ok refs/for/next/topic Z 77 + > remote: proc-receive> option refname refs/pull/124/head Z 78 + > remote: proc-receive> option old-oid <COMMIT-B> Z 79 + > remote: proc-receive> option new-oid <COMMIT-A> Z 80 + > remote: proc-receive> option forced-update Z 81 + > remote: # post-receive hook Z 82 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/bar Z 83 + > remote: post-receive< <COMMIT-A> <ZERO-OID> refs/heads/foo Z 84 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/heads/main Z 85 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head Z 86 + > remote: post-receive< <COMMIT-B> <COMMIT-A> refs/pull/124/head Z 87 + > To <URL/of/upstream.git> 88 + > <COMMIT-B>:refs/heads/bar <OID-A>..<OID-B> 89 + > - :refs/heads/foo [deleted] 90 + > + HEAD:refs/heads/main <OID-B>...<OID-A> (forced update) 91 + > HEAD:refs/pull/123/head <OID-A>..<OID-B> 92 + > + HEAD:refs/pull/124/head <OID-B>...<OID-A> (forced update) 93 + > Done 94 94 EOF 95 95 test_cmp expect actual && 96 96
+45 -45
t/t5411/test-0050-proc-receive-refs-with-modifiers.sh
··· 29 29 $B:refs/heads/main \ 30 30 v123 >out 2>&1 && 31 31 make_user_friendly_and_stable_output <out >actual && 32 - cat >expect <<-EOF && 33 - remote: # pre-receive hook 34 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 35 - remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 36 - remote: # proc-receive hook 37 - remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/main 38 - remote: proc-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 39 - remote: proc-receive> ok refs/heads/main 40 - remote: proc-receive> option refname refs/pull/123/head 41 - remote: proc-receive> option old-oid <COMMIT-A> 42 - remote: proc-receive> option new-oid <COMMIT-B> 43 - remote: proc-receive> ok refs/tags/v123 44 - remote: proc-receive> option refname refs/pull/124/head 45 - remote: # post-receive hook 46 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head 47 - remote: post-receive< <ZERO-OID> <TAG-v123> refs/pull/124/head 48 - To <URL/of/upstream.git> 49 - <OID-A>..<OID-B> <COMMIT-B> -> refs/pull/123/head 50 - * [new reference] v123 -> refs/pull/124/head 32 + format_and_save_expect <<-EOF && 33 + > remote: # pre-receive hook Z 34 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 35 + > remote: pre-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 Z 36 + > remote: # proc-receive hook Z 37 + > remote: proc-receive< <COMMIT-A> <COMMIT-B> refs/heads/main Z 38 + > remote: proc-receive< <ZERO-OID> <TAG-v123> refs/tags/v123 Z 39 + > remote: proc-receive> ok refs/heads/main Z 40 + > remote: proc-receive> option refname refs/pull/123/head Z 41 + > remote: proc-receive> option old-oid <COMMIT-A> Z 42 + > remote: proc-receive> option new-oid <COMMIT-B> Z 43 + > remote: proc-receive> ok refs/tags/v123 Z 44 + > remote: proc-receive> option refname refs/pull/124/head Z 45 + > remote: # post-receive hook Z 46 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/pull/123/head Z 47 + > remote: post-receive< <ZERO-OID> <TAG-v123> refs/pull/124/head Z 48 + > To <URL/of/upstream.git> 49 + > <OID-A>..<OID-B> <COMMIT-B> -> refs/pull/123/head 50 + > * [new reference] v123 -> refs/pull/124/head 51 51 EOF 52 52 test_cmp expect actual && 53 53 ··· 93 93 $A:refs/heads/next \ 94 94 :refs/tags/v123 >out 2>&1 && 95 95 make_user_friendly_and_stable_output <out >actual && 96 - cat >expect <<-EOF && 97 - remote: # pre-receive hook 98 - remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/main 99 - remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/topic 100 - remote: pre-receive< <TAG-v123> <ZERO-OID> refs/tags/v123 101 - remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 102 - remote: # proc-receive hook 103 - remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/main 104 - remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/heads/next 105 - remote: proc-receive> ok refs/heads/main 106 - remote: proc-receive> option refname refs/pull/123/head 107 - remote: proc-receive> option old-oid <COMMIT-A> 108 - remote: proc-receive> option new-oid <ZERO-OID> 109 - remote: proc-receive> ok refs/heads/next 110 - remote: proc-receive> option refname refs/pull/124/head 111 - remote: proc-receive> option new-oid <COMMIT-A> 112 - remote: # post-receive hook 113 - remote: post-receive< <COMMIT-A> <ZERO-OID> refs/pull/123/head 114 - remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/topic 115 - remote: post-receive< <TAG-v123> <ZERO-OID> refs/tags/v123 116 - remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/124/head 117 - To <URL/of/upstream.git> 118 - - [deleted] refs/pull/123/head 119 - <OID-A>..<OID-B> <COMMIT-B> -> topic 120 - - [deleted] v123 121 - * [new reference] <COMMIT-A> -> refs/pull/124/head 96 + format_and_save_expect <<-EOF && 97 + > remote: # pre-receive hook Z 98 + > remote: pre-receive< <COMMIT-A> <ZERO-OID> refs/heads/main Z 99 + > remote: pre-receive< <COMMIT-A> <COMMIT-B> refs/heads/topic Z 100 + > remote: pre-receive< <TAG-v123> <ZERO-OID> refs/tags/v123 Z 101 + > remote: pre-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 102 + > remote: # proc-receive hook Z 103 + > remote: proc-receive< <COMMIT-A> <ZERO-OID> refs/heads/main Z 104 + > remote: proc-receive< <ZERO-OID> <COMMIT-A> refs/heads/next Z 105 + > remote: proc-receive> ok refs/heads/main Z 106 + > remote: proc-receive> option refname refs/pull/123/head Z 107 + > remote: proc-receive> option old-oid <COMMIT-A> Z 108 + > remote: proc-receive> option new-oid <ZERO-OID> Z 109 + > remote: proc-receive> ok refs/heads/next Z 110 + > remote: proc-receive> option refname refs/pull/124/head Z 111 + > remote: proc-receive> option new-oid <COMMIT-A> Z 112 + > remote: # post-receive hook Z 113 + > remote: post-receive< <COMMIT-A> <ZERO-OID> refs/pull/123/head Z 114 + > remote: post-receive< <COMMIT-A> <COMMIT-B> refs/heads/topic Z 115 + > remote: post-receive< <TAG-v123> <ZERO-OID> refs/tags/v123 Z 116 + > remote: post-receive< <ZERO-OID> <COMMIT-A> refs/pull/124/head Z 117 + > To <URL/of/upstream.git> 118 + > - [deleted] refs/pull/123/head 119 + > <OID-A>..<OID-B> <COMMIT-B> -> topic 120 + > - [deleted] v123 121 + > * [new reference] <COMMIT-A> -> refs/pull/124/head 122 122 EOF 123 123 test_cmp expect actual && 124 124
+28 -26
t/t5548-push-porcelain.sh
··· 45 45 # of the output. 46 46 make_user_friendly_and_stable_output () { 47 47 sed \ 48 - -e "s/ *\$//" \ 49 - -e "s/ */ /g" \ 50 - -e "s/ / /g" \ 51 48 -e "s/$A/<COMMIT-A>/g" \ 52 49 -e "s/$B/<COMMIT-B>/g" \ 53 50 -e "s/$ZERO_OID/<ZERO-OID>/g" \ 54 51 -e "s/$(echo $A | cut -c1-7)[0-9a-f]*/<OID-A>/g" \ 55 52 -e "s/$(echo $B | cut -c1-7)[0-9a-f]*/<OID-B>/g" \ 56 53 -e "s#To $URL_PREFIX/upstream.git#To <URL/of/upstream.git>#" 54 + } 55 + 56 + format_and_save_expect () { 57 + sed -e 's/^> //' -e 's/Z$//' >expect 57 58 } 58 59 59 60 setup_upstream_and_workbench () { ··· 111 112 next 112 113 ) >out && 113 114 make_user_friendly_and_stable_output <out >actual && 114 - cat >expect <<-EOF && 115 - To <URL/of/upstream.git> 116 - = refs/heads/baz:refs/heads/baz [up to date] 117 - <COMMIT-B>:refs/heads/bar <OID-A>..<OID-B> 118 - - :refs/heads/foo [deleted] 119 - + refs/heads/main:refs/heads/main <OID-B>...<OID-A> (forced update) 120 - * refs/heads/next:refs/heads/next [new branch] 121 - Done 115 + format_and_save_expect <<-EOF && 116 + > To <URL/of/upstream.git> 117 + > = refs/heads/baz:refs/heads/baz [up to date] 118 + > <COMMIT-B>:refs/heads/bar <OID-A>..<OID-B> 119 + > - :refs/heads/foo [deleted] 120 + > + refs/heads/main:refs/heads/main <OID-B>...<OID-A> (forced update) 121 + > * refs/heads/next:refs/heads/next [new branch] 122 + > Done 122 123 EOF 123 124 test_cmp expect actual && 124 125 ··· 148 149 next 149 150 ) >out && 150 151 make_user_friendly_and_stable_output <out >actual && 151 - cat >expect <<-EOF && 152 + format_and_save_expect <<-EOF && 152 153 To <URL/of/upstream.git> 153 - = refs/heads/next:refs/heads/next [up to date] 154 - ! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward) 155 - ! (delete):refs/heads/baz [rejected] (atomic push failed) 156 - ! refs/heads/main:refs/heads/main [rejected] (atomic push failed) 154 + > = refs/heads/next:refs/heads/next [up to date] 155 + > ! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward) 156 + > ! (delete):refs/heads/baz [rejected] (atomic push failed) 157 + > ! refs/heads/main:refs/heads/main [rejected] (atomic push failed) 157 158 Done 158 159 EOF 159 160 test_cmp expect actual && ··· 168 169 EOF 169 170 test_cmp expect actual 170 171 ' 172 + 171 173 test_expect_success "prepare pre-receive hook ($PROTOCOL)" ' 172 174 write_script "$upstream/hooks/pre-receive" <<-EOF 173 175 exit 1 ··· 189 191 next 190 192 ) >out && 191 193 make_user_friendly_and_stable_output <out >actual && 192 - cat >expect <<-EOF && 194 + format_and_save_expect <<-EOF && 193 195 To <URL/of/upstream.git> 194 - = refs/heads/next:refs/heads/next [up to date] 195 - ! refs/heads/bar:refs/heads/bar [remote rejected] (pre-receive hook declined) 196 - ! :refs/heads/baz [remote rejected] (pre-receive hook declined) 197 - ! refs/heads/main:refs/heads/main [remote rejected] (pre-receive hook declined) 196 + > = refs/heads/next:refs/heads/next [up to date] 197 + > ! refs/heads/bar:refs/heads/bar [remote rejected] (pre-receive hook declined) 198 + > ! :refs/heads/baz [remote rejected] (pre-receive hook declined) 199 + > ! refs/heads/main:refs/heads/main [remote rejected] (pre-receive hook declined) 198 200 Done 199 201 EOF 200 202 test_cmp expect actual && ··· 227 229 next 228 230 ) >out && 229 231 make_user_friendly_and_stable_output <out >actual && 230 - cat >expect <<-EOF && 232 + format_and_save_expect <<-EOF && 231 233 To <URL/of/upstream.git> 232 - = refs/heads/next:refs/heads/next [up to date] 233 - - :refs/heads/baz [deleted] 234 - refs/heads/main:refs/heads/main <OID-A>..<OID-B> 235 - ! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward) 234 + > = refs/heads/next:refs/heads/next [up to date] 235 + > - :refs/heads/baz [deleted] 236 + > refs/heads/main:refs/heads/main <OID-A>..<OID-B> 237 + > ! refs/heads/bar:refs/heads/bar [rejected] (non-fast-forward) 236 238 Done 237 239 EOF 238 240 test_cmp expect actual &&
+24 -21
t/t6020-bundle-misc.sh
··· 82 82 83 83 # Format the output of git commands to make a user-friendly and stable 84 84 # text. We can easily prepare the expect text without having to worry 85 - # about future changes of the commit ID and spaces of the output. 85 + # about future changes of the commit ID. 86 86 make_user_friendly_and_stable_output () { 87 87 sed \ 88 88 -e "s/${A%${A#???????}}[0-9a-f]*/<COMMIT-A>/g" \ ··· 103 103 -e "s/${P%${P#???????}}[0-9a-f]*/<COMMIT-P>/g" \ 104 104 -e "s/${TAG1%${TAG1#???????}}[0-9a-f]*/<TAG-1>/g" \ 105 105 -e "s/${TAG2%${TAG2#???????}}[0-9a-f]*/<TAG-2>/g" \ 106 - -e "s/${TAG3%${TAG3#???????}}[0-9a-f]*/<TAG-3>/g" \ 107 - -e "s/ *\$//" 106 + -e "s/${TAG3%${TAG3#???????}}[0-9a-f]*/<TAG-3>/g" 107 + } 108 + 109 + format_and_save_expect () { 110 + sed -e 's/Z$//' >expect 108 111 } 109 112 110 113 # (C) (D, pull/1/head, topic/1) ··· 179 182 180 183 git bundle verify special-rev.bdl | 181 184 make_user_friendly_and_stable_output >actual && 182 - cat >expect <<-\EOF && 185 + format_and_save_expect <<-\EOF && 183 186 The bundle contains this ref: 184 187 <COMMIT-P> refs/heads/main 185 188 The bundle requires this ref: 186 - <COMMIT-O> 189 + <COMMIT-O> Z 187 190 EOF 188 191 test_cmp expect actual && 189 192 ··· 200 203 201 204 git bundle verify max-count.bdl | 202 205 make_user_friendly_and_stable_output >actual && 203 - cat >expect <<-\EOF && 206 + format_and_save_expect <<-\EOF && 204 207 The bundle contains these 2 refs: 205 208 <COMMIT-P> refs/heads/main 206 209 <TAG-1> refs/tags/v1 207 210 The bundle requires this ref: 208 - <COMMIT-O> 211 + <COMMIT-O> Z 209 212 EOF 210 213 test_cmp expect actual && 211 214 ··· 225 228 226 229 git bundle verify since.bdl | 227 230 make_user_friendly_and_stable_output >actual && 228 - cat >expect <<-\EOF && 231 + format_and_save_expect <<-\EOF && 229 232 The bundle contains these 5 refs: 230 233 <COMMIT-P> refs/heads/main 231 234 <COMMIT-N> refs/heads/release ··· 233 236 <TAG-3> refs/tags/v3 234 237 <COMMIT-P> HEAD 235 238 The bundle requires these 2 refs: 236 - <COMMIT-M> 237 - <COMMIT-K> 239 + <COMMIT-M> Z 240 + <COMMIT-K> Z 238 241 EOF 239 242 test_cmp expect actual && 240 243 ··· 293 296 --stdin \ 294 297 release <input && 295 298 296 - cat >expect <<-\EOF && 299 + format_and_save_expect <<-\EOF && 297 300 The bundle contains this ref: 298 301 <COMMIT-N> refs/heads/release 299 302 The bundle requires these 3 refs: 300 - <COMMIT-D> 301 - <COMMIT-E> 302 - <COMMIT-G> 303 + <COMMIT-D> Z 304 + <COMMIT-E> Z 305 + <COMMIT-G> Z 303 306 EOF 304 307 305 308 git bundle verify 2.bdl | ··· 317 320 test_expect_success 'fail to verify bundle without prerequisites' ' 318 321 git init --bare test1.git && 319 322 320 - cat >expect <<-\EOF && 323 + format_and_save_expect <<-\EOF && 321 324 error: Repository lacks these prerequisite commits: 322 - error: <COMMIT-D> 323 - error: <COMMIT-E> 324 - error: <COMMIT-G> 325 + error: <COMMIT-D> Z 326 + error: <COMMIT-E> Z 327 + error: <COMMIT-G> Z 325 328 EOF 326 329 327 330 test_must_fail git -C test1.git bundle verify ../2.bdl 2>&1 | ··· 352 355 --stdin \ 353 356 main HEAD <input && 354 357 355 - cat >expect <<-\EOF && 358 + format_and_save_expect <<-\EOF && 356 359 The bundle contains these 2 refs: 357 360 <COMMIT-P> refs/heads/main 358 361 <COMMIT-P> HEAD 359 362 The bundle requires these 2 refs: 360 - <COMMIT-M> 361 - <COMMIT-K> 363 + <COMMIT-M> Z 364 + <COMMIT-K> Z 362 365 EOF 363 366 364 367 git bundle verify 3.bdl |