Created
May 27, 2017 13:17
-
-
Save jvshahid/b778702cc3d825c6887d2707e866a9c8 to your computer and use it in GitHub Desktop.
test case for push with submodules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
test_description='diff-branch-submodule-push' | |
. ./test-lib.sh | |
test_expect_success setup ' | |
mkdir pub.git && | |
mkdir sub.git && | |
GIT_DIR=pub.git git init --bare && | |
GIT_DIR=sub.git git init --bare && | |
mkdir sub-repo && | |
( | |
cd sub-repo && | |
git init && | |
>junk && | |
git add . && | |
git commit -m "Initial junk" && | |
git remote add origin ../sub.git && | |
git push origin master | |
) && | |
mkdir work && | |
( | |
cd work && | |
git init && | |
git submodule add ../sub.git sub && | |
git add . && | |
git commit -m "Initial superproject" && | |
git remote add origin ../pub.git && | |
git push origin master | |
) | |
' | |
test_expect_success 'push if submodule has is on a different branch' ' | |
( | |
cd work/sub && | |
>junk2 && | |
git add junk2 && | |
git commit -m "Second junk" | |
) && | |
( | |
cd work && | |
git checkout -b develop && | |
git push --set-upstream origin develop | |
) && | |
( | |
cd work && | |
git add sub && | |
git commit -m "Second commit for gar/bage" && | |
git push --recurse-submodules=on-demand | |
) | |
' | |
test_done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment