From: Junio C Hamano Date: Mon, 5 Jun 2017 00:03:21 +0000 (+0900) Subject: Merge branch 'sb/t5531-update-desc' into maint X-Git-Tag: v2.13.1~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2ed824bce541e2b47c66fbe507082b122ee7ab4c?ds=inline;hp=-c Merge branch 'sb/t5531-update-desc' into maint The description strings for a few tests have been updated. * sb/t5531-update-desc: t5531: fix test description --- 2ed824bce541e2b47c66fbe507082b122ee7ab4c diff --combined t/t5531-deep-submodule-push.sh index 57ba322628,62160ab0ca..23c533e82e --- a/t/t5531-deep-submodule-push.sh +++ b/t/t5531-deep-submodule-push.sh @@@ -1,6 -1,6 +1,6 @@@ #!/bin/sh - test_description='unpack-objects' + test_description='test push with submodules' . ./test-lib.sh @@@ -27,7 -27,7 +27,7 @@@ test_expect_success setup ) ' - test_expect_success push ' + test_expect_success 'push works with recorded gitlink' ' ( cd work && git push ../pub.git master @@@ -475,56 -475,4 +475,56 @@@ test_expect_success 'push only unpushe test_cmp expected_pub actual_pub ' +test_expect_success 'push propagating the remotes name to a submodule' ' + git -C work remote add origin ../pub.git && + git -C work remote add pub ../pub.git && + + > work/gar/bage/junk10 && + git -C work/gar/bage add junk10 && + git -C work/gar/bage commit -m "Tenth junk" && + git -C work add gar/bage && + git -C work commit -m "Tenth junk added to gar/bage" && + + # Fails when submodule does not have a matching remote + test_must_fail git -C work push --recurse-submodules=on-demand pub master && + # Succeeds when submodules has matching remote and refspec + git -C work push --recurse-submodules=on-demand origin master && + + git -C submodule.git rev-parse master >actual_submodule && + git -C pub.git rev-parse master >actual_pub && + git -C work/gar/bage rev-parse master >expected_submodule && + git -C work rev-parse master >expected_pub && + test_cmp expected_submodule actual_submodule && + test_cmp expected_pub actual_pub +' + +test_expect_success 'push propagating refspec to a submodule' ' + > work/gar/bage/junk11 && + git -C work/gar/bage add junk11 && + git -C work/gar/bage commit -m "Eleventh junk" && + + git -C work checkout branch2 && + git -C work add gar/bage && + git -C work commit -m "updating gar/bage in branch2" && + + # Fails when submodule does not have a matching branch + test_must_fail git -C work push --recurse-submodules=on-demand origin branch2 && + # Fails when refspec includes an object id + test_must_fail git -C work push --recurse-submodules=on-demand origin \ + "$(git -C work rev-parse branch2):refs/heads/branch2" && + # Fails when refspec includes 'HEAD' as it is unsupported at this time + test_must_fail git -C work push --recurse-submodules=on-demand origin \ + HEAD:refs/heads/branch2 && + + git -C work/gar/bage branch branch2 master && + git -C work push --recurse-submodules=on-demand origin branch2 && + + git -C submodule.git rev-parse branch2 >actual_submodule && + git -C pub.git rev-parse branch2 >actual_pub && + git -C work/gar/bage rev-parse branch2 >expected_submodule && + git -C work rev-parse branch2 >expected_pub && + test_cmp expected_submodule actual_submodule && + test_cmp expected_pub actual_pub +' + test_done