request-pull: test updates

This illustrates behaviour changes that result from the recent change by Linus. Most show good changes, but there may be some usability regressions: - The command continues to fail when the user forgot to push out before running the command, but the wording of the message has been slightly changed. - The command no longer guesses when asked to request the commit at the HEAD be pulled after pushing it to a branch 'for-upstream', even when that branch points at the correct commit. The user must ask the command with the new "master:for-upstream" syntax. The new behaviour needs to be documented in any case, but we need to agree what the new behaviour should be before doing so first. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jan 23, 2014 at 14:23 UTC 28ad685f70f93133f2c872e4b1ea2a8f87eaebb5
1 file changed +8 -8
t/t5150-request-pull.sh
+8 -8
@@ -86,7 +86,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '
86 s/[-0-9]\{10\} [:0-9]\{8\} [-+][0-9]\{4\}/DATE/g
87 s/ [^ ].*/ SUBJECT/g
88 s/ [^ ].* (DATE)/ SUBJECT (DATE)/g
89 - s/for-upstream/BRANCH/g
89 + s|tags/full|BRANCH|g
90 s/mnemonic.txt/FILENAME/g
91 s/^version [0-9]/VERSION/
92 /^ FILENAME | *[0-9]* [-+]*\$/ b diffstat
@@ -127,7 +127,7 @@ test_expect_success 'pull request when forgot to push' '
127 test_must_fail git request-pull initial "$downstream_url" \
128 2>../err
129 ) &&
130 - grep "No branch of.*is at:\$" err &&
130 + grep "No match for commit .*" err &&
131 grep "Are you sure you pushed" err
132
133 '
@@ -141,7 +141,7 @@ test_expect_success 'pull request after push' '
141 git checkout initial &&
142 git merge --ff-only master &&
143 git push origin master:for-upstream &&
144 - git request-pull initial origin >../request
144 + git request-pull initial origin master:for-upstream >../request
145 ) &&
146 sed -nf read-request.sed <request >digest &&
147 cat digest &&
@@ -160,7 +160,7 @@ test_expect_success 'pull request after push' '
160
161 '
162
163 -test_expect_success 'request names an appropriate branch' '
163 +test_expect_success 'request asks HEAD to be pulled' '
164
165 rm -fr downstream.git &&
166 git init --bare downstream.git &&
@@ -179,7 +179,7 @@ test_expect_success 'request names an appropriate branch' '
179 read repository &&
180 read branch
181 } <digest &&
182 - test "$branch" = tags/full
182 + test -z "$branch"
183
184 '
185
@@ -212,8 +212,8 @@ test_expect_success 'pull request format' '
212 cd local &&
213 git checkout initial &&
214 git merge --ff-only master &&
215 - git push origin master:for-upstream &&
216 - git request-pull initial "$downstream_url" >../request
215 + git push origin tags/full &&
216 + git request-pull initial "$downstream_url" tags/full >../request
217 ) &&
218 <request sed -nf fuzz.sed >request.fuzzy &&
219 test_i18ncmp expect request.fuzzy
@@ -229,7 +229,7 @@ test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
229 git checkout initial &&
230 git merge --ff-only master &&
231 git push origin master:for-upstream &&
232 - git request-pull -- initial "$downstream_url" >../request
232 + git request-pull -- initial "$downstream_url" master:for-upstream >../request
233 )
234
235 '