diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-10 17:02:49 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-10 17:02:49 +0900 |
commit | eba2a68f25c8afc56e204daf707e80613cc6e926 (patch) | |
tree | 6d509543f8913fd3dc62cbd1b1098b9b5a753234 /t | |
parent | 702239d049dbd95f55c898c4707a3615b0237abd (diff) | |
parent | c7be7201a7b71f590325f0d858f909a4c0b443f6 (diff) | |
download | git-eba2a68f25c8afc56e204daf707e80613cc6e926.tar.gz |
Merge branch 'bw/push-options-recursively-to-submodules' into maint
"git push --recurse-submodules $there HEAD:$target" was not
propagated down to the submodules, but now it is.
* bw/push-options-recursively-to-submodules:
submodule--helper: teach push-check to handle HEAD
Diffstat (limited to 't')
-rwxr-xr-x | t/t5531-deep-submodule-push.sh | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh index beff65b8ac..0f84a53146 100755 --- a/t/t5531-deep-submodule-push.sh +++ b/t/t5531-deep-submodule-push.sh @@ -533,7 +533,8 @@ test_expect_success 'push propagating refspec to a submodule' ' # 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 + # Fails when refspec includes HEAD and parent and submodule do not + # have the same named branch checked out test_must_fail git -C work push --recurse-submodules=on-demand origin \ HEAD:refs/heads/branch2 && @@ -548,4 +549,26 @@ test_expect_success 'push propagating refspec to a submodule' ' test_cmp expected_pub actual_pub ' +test_expect_success 'push propagating HEAD refspec to a submodule' ' + git -C work/gar/bage checkout branch2 && + > work/gar/bage/junk12 && + git -C work/gar/bage add junk12 && + git -C work/gar/bage commit -m "Twelfth junk" && + + git -C work checkout branch2 && + git -C work add gar/bage && + git -C work commit -m "updating gar/bage in branch2" && + + # Passes since the superproject and submodules HEAD are both on branch2 + git -C work push --recurse-submodules=on-demand origin \ + HEAD:refs/heads/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 |