3 test_description='unpack-objects'
7 test_expect_success setup '
9 GIT_DIR=pub.git git init --bare &&
10 GIT_DIR=pub.git git config receive.fsckobjects true &&
21 git commit -m "Initial junk"
24 git commit -m "Initial superproject"
28 test_expect_success push '
31 git push ../pub.git master
35 test_expect_success 'push if submodule has no remote' '
40 git commit -m "Second junk"
45 git commit -m "Second commit for gar/bage" &&
46 git push --recurse-submodules=check ../pub.git master
50 test_expect_success 'push fails if submodule commit not on remote' '
53 git clone --bare bage ../../submodule.git &&
55 git remote add origin ../../../submodule.git &&
59 git commit -m "Third junk"
64 git commit -m "Third commit for gar/bage" &&
65 test_must_fail git push --recurse-submodules=check ../pub.git master
69 test_expect_success 'push succeeds after commit was pushed to remote' '
72 git push origin master
76 git push --recurse-submodules=check ../pub.git master
80 test_expect_success 'push fails when commit on multiple branches if one branch has no remote' '
85 git commit -m "Fourth junk"
91 git commit -m "Fourth commit for gar/bage" &&
92 git checkout branch2 &&
99 git commit -m "First junk" &&
100 test_must_fail git push --recurse-submodules=check ../pub.git
104 test_expect_success 'push succeeds if submodule has no remote and is on the first superproject commit' '
114 git commit -m "initial"
117 git commit -m "added submodule" &&
118 git push --recurse-submodule=check origin master