Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 28ad685

Browse files
committed
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 <[email protected]>
1 parent 4b14ec8 commit 28ad685

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

t/t5150-request-pull.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ test_expect_success 'setup: two scripts for reading pull requests' '
8686
s/[-0-9]\{10\} [:0-9]\{8\} [-+][0-9]\{4\}/DATE/g
8787
s/ [^ ].*/ SUBJECT/g
8888
s/ [^ ].* (DATE)/ SUBJECT (DATE)/g
89-
s/for-upstream/BRANCH/g
89+
s|tags/full|BRANCH|g
9090
s/mnemonic.txt/FILENAME/g
9191
s/^version [0-9]/VERSION/
9292
/^ FILENAME | *[0-9]* [-+]*\$/ b diffstat
@@ -127,7 +127,7 @@ test_expect_success 'pull request when forgot to push' '
127127
test_must_fail git request-pull initial "$downstream_url" \
128128
2>../err
129129
) &&
130-
grep "No branch of.*is at:\$" err &&
130+
grep "No match for commit .*" err &&
131131
grep "Are you sure you pushed" err
132132
133133
'
@@ -141,7 +141,7 @@ test_expect_success 'pull request after push' '
141141
git checkout initial &&
142142
git merge --ff-only master &&
143143
git push origin master:for-upstream &&
144-
git request-pull initial origin >../request
144+
git request-pull initial origin master:for-upstream >../request
145145
) &&
146146
sed -nf read-request.sed <request >digest &&
147147
cat digest &&
@@ -160,7 +160,7 @@ test_expect_success 'pull request after push' '
160160
161161
'
162162

163-
test_expect_success 'request names an appropriate branch' '
163+
test_expect_success 'request asks HEAD to be pulled' '
164164
165165
rm -fr downstream.git &&
166166
git init --bare downstream.git &&
@@ -179,7 +179,7 @@ test_expect_success 'request names an appropriate branch' '
179179
read repository &&
180180
read branch
181181
} <digest &&
182-
test "$branch" = tags/full
182+
test -z "$branch"
183183
184184
'
185185

@@ -212,8 +212,8 @@ test_expect_success 'pull request format' '
212212
cd local &&
213213
git checkout initial &&
214214
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
217217
) &&
218218
<request sed -nf fuzz.sed >request.fuzzy &&
219219
test_i18ncmp expect request.fuzzy
@@ -229,7 +229,7 @@ test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
229229
git checkout initial &&
230230
git merge --ff-only master &&
231231
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
233233
)
234234
235235
'

0 commit comments

Comments
 (0)