]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5516-fetch-push.sh
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / t / t5516-fetch-push.sh
index 2f04cf9a1c7700c599237cee93c3877a0f9f649e..87881726edf7f3cf187ac76a76c256662d3e16e0 100755 (executable)
@@ -229,6 +229,18 @@ test_expect_success 'push with negotiation proceeds anyway even if negotiation f
        test_i18ngrep "push negotiation failed" err
 '
 
+test_expect_success 'push with negotiation does not attempt to fetch submodules' '
+       mk_empty submodule_upstream &&
+       test_commit -C submodule_upstream submodule_commit &&
+       git submodule add ./submodule_upstream submodule &&
+       mk_empty testrepo &&
+       git push testrepo $the_first_commit:refs/remotes/origin/first_commit &&
+       test_commit -C testrepo unrelated_commit &&
+       git -C testrepo config receive.hideRefs refs/remotes/origin/first_commit &&
+       git -c submodule.recurse=true -c protocol.version=2 -c push.negotiate=1 push testrepo refs/heads/main:refs/remotes/origin/main 2>err &&
+       ! grep "Fetching submodule" err
+'
+
 test_expect_success 'push without wildcard' '
        mk_empty testrepo &&