summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-25 21:27:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-25 21:27:11 (GMT)
commit58f34846d5858908b365011d17f1c552b4ad7fad (patch)
tree7d8737874306491d37f121464dfcbfc5743a46ef /t
parent0eb2774b25641d797ffb09a884b85e93a6563648 (diff)
parent0454220d66581f28b9688bc1b687f52cb9561798 (diff)
downloadgit-58f34846d5858908b365011d17f1c552b4ad7fad.zip
git-58f34846d5858908b365011d17f1c552b4ad7fad.tar.gz
git-58f34846d5858908b365011d17f1c552b4ad7fad.tar.bz2
Merge branch 'pb/request-pull-verify-remote-ref' into maint
"git request-pull" learned to warn when the ref we ask them to pull from in the local repository and in the published repository are different. * pb/request-pull-verify-remote-ref: request-pull: warn if the remote object is not the same as the local one request-pull: quote regex metacharacters in local ref
Diffstat (limited to 't')
-rwxr-xr-xt/t5150-request-pull.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh
index fca001e..852dcd9 100755
--- a/t/t5150-request-pull.sh
+++ b/t/t5150-request-pull.sh
@@ -246,4 +246,57 @@ test_expect_success 'request-pull ignores OPTIONS_KEEPDASHDASH poison' '
'
+test_expect_success 'request-pull quotes regex metacharacters properly' '
+
+ rm -fr downstream.git &&
+ git init --bare downstream.git &&
+ (
+ cd local &&
+ git checkout initial &&
+ git merge --ff-only master &&
+ git tag -mrelease v2.0 &&
+ git push origin refs/tags/v2.0:refs/tags/v2-0 &&
+ test_must_fail git request-pull initial "$downstream_url" tags/v2.0 \
+ 2>../err
+ ) &&
+ grep "No match for commit .*" err &&
+ grep "Are you sure you pushed" err
+
+'
+
+test_expect_success 'pull request with mismatched object' '
+
+ rm -fr downstream.git &&
+ git init --bare downstream.git &&
+ (
+ cd local &&
+ git checkout initial &&
+ git merge --ff-only master &&
+ git push origin HEAD:refs/tags/full &&
+ test_must_fail git request-pull initial "$downstream_url" tags/full \
+ 2>../err
+ ) &&
+ grep "points to a different object" err &&
+ grep "Are you sure you pushed" err
+
+'
+
+test_expect_success 'pull request with stale object' '
+
+ rm -fr downstream.git &&
+ git init --bare downstream.git &&
+ (
+ cd local &&
+ git checkout initial &&
+ git merge --ff-only master &&
+ git push origin refs/tags/full &&
+ git tag -f -m"Thirty-one days" full &&
+ test_must_fail git request-pull initial "$downstream_url" tags/full \
+ 2>../err
+ ) &&
+ grep "points to a different object" err &&
+ grep "Are you sure you pushed" err
+
+'
+
test_done