3 # Copyright (c) 2009 Red Hat, Inc.
6 test_description
='Test updating submodules
8 This test verifies that "git submodule update" detaches the HEAD of the
9 submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
12 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
13 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
20 sha_main
=$
(git rev-list
--max-count=1 main
)
21 sha_head
=$
(git rev-list
--max-count=1 HEAD
)
23 test "$sha_main" = "$sha_head"
27 test_expect_success
'setup a submodule tree' '
31 git commit -m upstream &&
33 git clone super submodule &&
34 git clone super rebasing &&
35 git clone super merging &&
36 git clone super none &&
38 git submodule add ../submodule submodule &&
40 git commit -m "submodule" &&
41 git submodule init submodule
44 echo "line2" > file &&
46 git commit -m "Commit 2"
50 git pull --rebase origin
53 git commit -m "submodule update"
56 git submodule add ../rebasing rebasing &&
58 git commit -m "rebasing"
61 git submodule add ../merging merging &&
63 git commit -m "rebasing"
66 git submodule add ../none none &&
70 git clone . recursivesuper &&
71 ( cd recursivesuper &&
72 git submodule add ../super super
76 test_expect_success
'update --remote falls back to using HEAD' '
77 test_create_repo main-branch-submodule &&
78 test_commit -C main-branch-submodule initial &&
80 test_create_repo main-branch &&
81 git -C main-branch submodule add ../main-branch-submodule &&
82 git -C main-branch commit -m add-submodule &&
84 git -C main-branch-submodule switch -c hello &&
85 test_commit -C main-branch-submodule world &&
87 git clone --recursive main-branch main-branch-clone &&
88 git -C main-branch-clone submodule update --remote main-branch-submodule &&
89 test_path_exists main-branch-clone/main-branch-submodule/world.t
92 test_expect_success
'submodule update detaching the HEAD ' '
93 (cd super/submodule &&
94 git reset --hard HEAD~1
100 git submodule update submodule &&
106 test_expect_success
'submodule update from subdirectory' '
107 (cd super/submodule &&
108 git reset --hard HEAD~1
115 git submodule update ../submodule &&
121 supersha1
=$
(git
-C super rev-parse HEAD
)
122 mergingsha1
=$
(git
-C super
/merging rev-parse HEAD
)
123 nonesha1
=$
(git
-C super
/none rev-parse HEAD
)
124 rebasingsha1
=$
(git
-C super
/rebasing rev-parse HEAD
)
125 submodulesha1
=$
(git
-C super
/submodule rev-parse HEAD
)
129 Submodule path '../super': checked out '$supersha1'
130 Submodule path '../super/merging': checked out '$mergingsha1'
131 Submodule path '../super/none': checked out '$nonesha1'
132 Submodule path '../super/rebasing': checked out '$rebasingsha1'
133 Submodule path '../super/submodule': checked out '$submodulesha1'
137 Cloning into '$pwd/recursivesuper/super/merging'...
138 Cloning into '$pwd/recursivesuper/super/none'...
139 Cloning into '$pwd/recursivesuper/super/rebasing'...
140 Cloning into '$pwd/recursivesuper/super/submodule'...
141 Submodule 'merging' ($pwd/merging) registered for path '../super/merging'
142 Submodule 'none' ($pwd/none) registered for path '../super/none'
143 Submodule 'rebasing' ($pwd/rebasing) registered for path '../super/rebasing'
144 Submodule 'submodule' ($pwd/submodule) registered for path '../super/submodule'
151 test_expect_success
'submodule update --init --recursive from subdirectory' '
152 git -C recursivesuper/super reset --hard HEAD^ &&
153 (cd recursivesuper &&
156 git submodule update --init --recursive ../super >../../actual 2>../../actual2
158 test_cmp expect actual &&
159 sort actual2 >actual2.sorted &&
160 test_cmp expect2 actual2.sorted
164 Submodule 'foo/sub' ($pwd/withsubs/../rebasing) registered for path 'sub'
167 test_expect_success
'submodule update --init from and of subdirectory' '
171 git submodule add "$(pwd)/../rebasing" foo/sub &&
173 git submodule deinit -f sub &&
174 git submodule update --init sub 2>../../actual2
177 test_cmp expect2 actual2
180 test_expect_success
'submodule update does not fetch already present commits' '
182 echo line3 >> file &&
185 git commit -m "upstream line3"
187 (cd super/submodule &&
188 head=$(git rev-parse --verify HEAD) &&
189 echo "Submodule path ${SQ}submodule$SQ: checked out $SQ$head$SQ" > ../../expected &&
190 git reset --hard HEAD~1
193 git submodule update > ../actual 2> ../actual.err
195 test_cmp expected actual &&
196 test_must_be_empty actual.err
199 test_expect_success
'submodule update should fail due to local changes' '
200 (cd super/submodule &&
201 git reset --hard HEAD~1 &&
202 echo "local change" > file
208 test_must_fail git submodule update submodule 2>../actual.raw
210 sed "s/^> //" >expect <<-\EOF &&
211 > error: Your local changes to the following files would be overwritten by checkout:
213 > Please commit your changes or stash them before you switch branches.
215 > fatal: Unable to checkout OID in submodule path '\''submodule'\''
217 sed -e "s/checkout $SQ[^$SQ]*$SQ/checkout OID/" <actual.raw >actual &&
218 test_cmp expect actual
221 test_expect_success
'submodule update should throw away changes with --force ' '
226 git submodule update --force submodule &&
232 test_expect_success
'submodule update --force forcibly checks out submodules' '
237 git submodule update --force submodule &&
239 test "$(git status -s file)" = ""
244 test_expect_success
'submodule update --remote should fetch upstream changes' '
246 echo line4 >> file &&
249 git commit -m "upstream line4"
252 git submodule update --remote --force submodule &&
254 test "$(git log -1 --oneline)" = "$(GIT_DIR=../../submodule/.git git log -1 --oneline)"
258 test_expect_success
'submodule update --remote should fetch upstream changes with .' '
261 git config -f .gitmodules submodule."submodule".branch "." &&
262 git add .gitmodules &&
263 git commit -m "submodules: update from the respective superproject branch"
267 echo line4a >> file &&
270 git commit -m "upstream line4a" &&
271 git checkout -b test-branch &&
272 test_commit on-test-branch
276 git submodule update --remote --force submodule &&
277 git -C submodule log -1 --oneline >actual &&
278 git -C ../submodule log -1 --oneline main >expect &&
279 test_cmp expect actual &&
280 git checkout -b test-branch &&
281 git submodule update --remote --force submodule &&
282 git -C submodule log -1 --oneline >actual &&
283 git -C ../submodule log -1 --oneline test-branch >expect &&
284 test_cmp expect actual &&
286 git branch -d test-branch &&
287 git reset --hard HEAD^
291 test_expect_success
'local config should override .gitmodules branch' '
293 git checkout test-branch &&
294 echo line5 >> file &&
297 git commit -m "upstream line5" &&
301 git config submodule.submodule.branch test-branch &&
302 git submodule update --remote --force submodule &&
304 test "$(git log -1 --oneline)" = "$(GIT_DIR=../../submodule/.git git log -1 --oneline test-branch)"
308 test_expect_success
'submodule update --rebase staying on main' '
309 (cd super/submodule &&
316 git submodule update --rebase submodule &&
322 test_expect_success
'submodule update --merge staying on main' '
323 (cd super/submodule &&
324 git reset --hard HEAD~1
330 git submodule update --merge submodule &&
336 test_expect_success
'submodule update - rebase in .git/config' '
338 git config submodule.submodule.update rebase
340 (cd super/submodule &&
341 git reset --hard HEAD~1
347 git submodule update submodule &&
353 test_expect_success
'submodule update - checkout in .git/config but --rebase given' '
355 git config submodule.submodule.update checkout
357 (cd super/submodule &&
358 git reset --hard HEAD~1
364 git submodule update --rebase submodule &&
370 test_expect_success
'submodule update - merge in .git/config' '
372 git config submodule.submodule.update merge
374 (cd super/submodule &&
375 git reset --hard HEAD~1
381 git submodule update submodule &&
387 test_expect_success
'submodule update - checkout in .git/config but --merge given' '
389 git config submodule.submodule.update checkout
391 (cd super/submodule &&
392 git reset --hard HEAD~1
398 git submodule update --merge submodule &&
404 test_expect_success
'submodule update - checkout in .git/config' '
406 git config submodule.submodule.update checkout
408 (cd super/submodule &&
409 git reset --hard HEAD^
415 git submodule update submodule &&
421 test_expect_success
'submodule update - command in .git/config' '
423 git config submodule.submodule.update "!git checkout"
425 (cd super/submodule &&
426 git reset --hard HEAD^
432 git submodule update submodule &&
438 test_expect_success
'submodule update - command in .gitmodules is rejected' '
439 test_when_finished "git -C super reset --hard HEAD^" &&
440 git -C super config -f .gitmodules submodule.submodule.update "!false" &&
441 git -C super commit -a -m "add command to .gitmodules file" &&
442 git -C super/submodule reset --hard $submodulesha1^ &&
443 test_must_fail git -C super submodule update submodule
446 test_expect_success
'fsck detects command in .gitmodules' '
447 git init command-in-gitmodules &&
449 cd command-in-gitmodules &&
450 git submodule add ../submodule submodule &&
451 test_commit adding-submodule &&
453 git config -f .gitmodules submodule.submodule.update "!false" &&
454 git add .gitmodules &&
455 test_commit configuring-update &&
456 test_must_fail git fsck
461 fatal: Execution of 'false $submodulesha1' failed in submodule path 'submodule'
464 test_expect_success
'submodule update - command in .git/config catches failure' '
466 git config submodule.submodule.update "!false"
468 (cd super/submodule &&
469 git reset --hard $submodulesha1^
472 test_must_fail git submodule update submodule 2>../actual
474 test_cmp actual expect
478 fatal: Execution of 'false $submodulesha1' failed in submodule path '../submodule'
481 test_expect_success
'submodule update - command in .git/config catches failure -- subdirectory' '
483 git config submodule.submodule.update "!false"
485 (cd super/submodule &&
486 git reset --hard $submodulesha1^
489 mkdir tmp && cd tmp &&
490 test_must_fail git submodule update ../submodule 2>../../actual
492 test_cmp actual expect
495 test_expect_success
'submodule update - command run for initial population of submodule' '
496 cat >expect <<-EOF &&
497 fatal: Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
499 rm -rf super/submodule &&
500 test_must_fail git -C super submodule update 2>actual &&
501 test_cmp expect actual &&
502 git -C super submodule update --checkout
506 fatal: Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'
507 fatal: Failed to recurse into submodule path '../super'
510 test_expect_success
'recursive submodule update - command in .git/config catches failure -- subdirectory' '
511 (cd recursivesuper &&
512 git submodule update --remote super &&
514 git commit -m "update to latest to have more than one commit in submodules"
516 git -C recursivesuper/super config submodule.submodule.update "!false" &&
517 git -C recursivesuper/super/submodule reset --hard $submodulesha1^ &&
518 (cd recursivesuper &&
519 mkdir -p tmp && cd tmp &&
520 test_must_fail git submodule update --recursive ../super 2>../../actual
522 test_cmp actual expect
525 test_expect_success
'submodule init does not copy command into .git/config' '
526 test_when_finished "git -C super update-index --force-remove submodule1" &&
527 test_when_finished git config -f super/.gitmodules \
528 --remove-section submodule.submodule1 &&
530 git ls-files -s submodule >out &&
531 H=$(cut -d" " -f2 out) &&
533 git update-index --add --cacheinfo 160000 $H submodule1 &&
534 git config -f .gitmodules submodule.submodule1.path submodule1 &&
535 git config -f .gitmodules submodule.submodule1.url ../submodule &&
536 git config -f .gitmodules submodule.submodule1.update !false &&
537 test_must_fail git submodule init submodule1 &&
538 test_expect_code 1 git config submodule.submodule1.update >actual &&
539 test_must_be_empty actual
543 test_expect_success
'submodule init picks up rebase' '
545 git config -f .gitmodules submodule.rebasing.update rebase &&
546 git submodule init rebasing &&
547 test "rebase" = "$(git config submodule.rebasing.update)"
551 test_expect_success
'submodule init picks up merge' '
553 git config -f .gitmodules submodule.merging.update merge &&
554 git submodule init merging &&
555 test "merge" = "$(git config submodule.merging.update)"
559 test_expect_success
'submodule update --merge - ignores --merge for new submodules' '
560 test_config -C super submodule.submodule.update checkout &&
563 git submodule update submodule &&
564 git status -s submodule >expect &&
566 git submodule update --merge submodule &&
567 git status -s submodule >actual &&
568 test_cmp expect actual
572 test_expect_success
'submodule update --rebase - ignores --rebase for new submodules' '
573 test_config -C super submodule.submodule.update checkout &&
576 git submodule update submodule &&
577 git status -s submodule >expect &&
579 git submodule update --rebase submodule &&
580 git status -s submodule >actual &&
581 test_cmp expect actual
585 test_expect_success
'submodule update ignores update=merge config for new submodules' '
588 git submodule update submodule &&
589 git status -s submodule >expect &&
591 git config submodule.submodule.update merge &&
592 git submodule update submodule &&
593 git status -s submodule >actual &&
594 git config --unset submodule.submodule.update &&
595 test_cmp expect actual
599 test_expect_success
'submodule update ignores update=rebase config for new submodules' '
602 git submodule update submodule &&
603 git status -s submodule >expect &&
605 git config submodule.submodule.update rebase &&
606 git submodule update submodule &&
607 git status -s submodule >actual &&
608 git config --unset submodule.submodule.update &&
609 test_cmp expect actual
613 test_expect_success
'submodule init picks up update=none' '
615 git config -f .gitmodules submodule.none.update none &&
616 git submodule init none &&
617 test "none" = "$(git config submodule.none.update)"
621 test_expect_success
'submodule update - update=none in .git/config' '
623 git config submodule.submodule.update none &&
628 git diff --name-only >out &&
629 grep ^submodule$ out &&
630 git submodule update &&
631 git diff --name-only >out &&
632 grep ^submodule$ out &&
636 git config --unset submodule.submodule.update &&
637 git submodule update submodule
641 test_expect_success
'submodule update - update=none in .git/config but --checkout given' '
643 git config submodule.submodule.update none &&
648 git diff --name-only >out &&
649 grep ^submodule$ out &&
650 git submodule update --checkout &&
651 git diff --name-only >out &&
652 ! grep ^submodule$ out &&
656 git config --unset submodule.submodule.update
660 test_expect_success
'submodule update --init skips submodule with update=none' '
662 git add .gitmodules &&
663 git commit -m ".gitmodules"
665 git clone super cloned &&
667 git submodule update --init &&
668 test_path_exists submodule/.git &&
669 test_path_is_missing none/.git
673 test_expect_success
'submodule update with pathspec warns against uninitialized ones' '
674 test_when_finished "rm -fr selective" &&
675 git clone super selective &&
678 git submodule init submodule &&
680 git submodule update submodule 2>err &&
681 ! grep "Submodule path .* not initialized" err &&
683 git submodule update rebasing 2>err &&
684 grep "Submodule path .rebasing. not initialized" err &&
686 test_path_exists submodule/.git &&
687 test_path_is_missing rebasing/.git
692 test_expect_success
'submodule update without pathspec updates only initialized ones' '
693 test_when_finished "rm -fr selective" &&
694 git clone super selective &&
697 git submodule init submodule &&
698 git submodule update 2>err &&
699 test_path_exists submodule/.git &&
700 test_path_is_missing rebasing/.git &&
701 ! grep "Submodule path .* not initialized" err
706 test_expect_success
'submodule update continues after checkout error' '
708 git reset --hard HEAD &&
709 git submodule add ../submodule submodule2 &&
710 git submodule init &&
711 git commit -am "new_submodule" &&
713 git rev-parse --verify HEAD >../expect
716 test_commit "update_submodule" file
719 test_commit "update_submodule2" file
722 git add submodule2 &&
723 git commit -m "two_new_submodule_commits" &&
727 git checkout HEAD^ &&
728 test_must_fail git submodule update &&
730 git rev-parse --verify HEAD >../actual
732 test_cmp expect actual
735 test_expect_success
'submodule update continues after recursive checkout error' '
737 git reset --hard HEAD &&
739 git submodule update &&
741 git submodule add ../submodule subsubmodule &&
742 git submodule init &&
743 git commit -m "new_subsubmodule"
746 git commit -m "update_submodule" &&
749 test_commit "update_subsubmodule" file
751 git add subsubmodule &&
752 test_commit "update_submodule_again" file &&
754 test_commit "update_subsubmodule_again" file
756 test_commit "update_submodule_again_again" file
759 git rev-parse --verify HEAD >../expect &&
760 test_commit "update_submodule2_again" file
763 git add submodule2 &&
764 git commit -m "new_commits" &&
765 git checkout HEAD^ &&
767 git checkout HEAD^ &&
772 test_must_fail git submodule update --recursive &&
774 git rev-parse --verify HEAD >../actual
776 test_cmp expect actual
780 test_expect_success
'submodule update exit immediately in case of merge conflict' '
783 git reset --hard HEAD &&
786 git reset --hard HEAD
789 git submodule update --recursive &&
791 test_commit "update_submodule_2" file
794 test_commit "update_submodule2_2" file
797 git add submodule2 &&
798 git commit -m "two_new_submodule_commits" &&
801 test_commit "conflict" file &&
802 echo "conflict" > file
804 git checkout HEAD^ &&
806 git rev-parse --verify HEAD >../expect
808 git config submodule.submodule.update merge &&
809 test_must_fail git submodule update &&
811 git rev-parse --verify HEAD >../actual
813 test_cmp expect actual
817 test_expect_success
'submodule update exit immediately after recursive rebase error' '
820 git reset --hard HEAD &&
822 git reset --hard HEAD &&
823 git submodule update --recursive
826 test_commit "update_submodule_3" file
829 test_commit "update_submodule2_3" file
832 git add submodule2 &&
833 git commit -m "two_new_submodule_commits" &&
836 test_commit "conflict2" file &&
837 echo "conflict" > file
839 git checkout HEAD^ &&
841 git rev-parse --verify HEAD >../expect
843 git config submodule.submodule.update rebase &&
844 test_must_fail git submodule update &&
846 git rev-parse --verify HEAD >../actual
848 test_cmp expect actual
852 test_expect_success
'add different submodules to the same path' '
854 git submodule add ../submodule s1 &&
855 test_must_fail git submodule add ../merging s1
859 test_expect_success
'submodule add places git-dir in superprojects git-dir' '
862 git submodule add ../submodule deeper/submodule &&
863 (cd deeper/submodule &&
864 git log > ../../expected
866 (cd .git/modules/deeper/submodule &&
867 git log > ../../../../actual
869 test_cmp expected actual
873 test_expect_success
'submodule update places git-dir in superprojects git-dir' '
875 git commit -m "added submodule"
877 git clone super super2 &&
879 git submodule init deeper/submodule &&
880 git submodule update &&
881 (cd deeper/submodule &&
882 git log > ../../expected
884 (cd .git/modules/deeper/submodule &&
885 git log > ../../../../actual
887 test_cmp expected actual
891 test_expect_success
'submodule add places git-dir in superprojects git-dir recursive' '
893 (cd deeper/submodule &&
894 git submodule add ../submodule subsubmodule &&
896 git log > ../../../expected
898 git commit -m "added subsubmodule" &&
901 (cd .git/modules/deeper/submodule/modules/subsubmodule &&
902 git log > ../../../../../actual
904 git add deeper/submodule &&
905 git commit -m "update submodule" &&
907 test_cmp expected actual
911 test_expect_success
'submodule update places git-dir in superprojects git-dir recursive' '
912 mkdir super_update_r &&
913 (cd super_update_r &&
916 mkdir subsuper_update_r &&
917 (cd subsuper_update_r &&
920 mkdir subsubsuper_update_r &&
921 (cd subsubsuper_update_r &&
924 git clone subsubsuper_update_r subsubsuper_update_r2 &&
925 (cd subsubsuper_update_r2 &&
926 test_commit "update_subsubsuper" file &&
929 git clone subsuper_update_r subsuper_update_r2 &&
930 (cd subsuper_update_r2 &&
931 test_commit "update_subsuper" file &&
932 git submodule add ../subsubsuper_update_r subsubmodule &&
933 git commit -am "subsubmodule" &&
936 git clone super_update_r super_update_r2 &&
937 (cd super_update_r2 &&
938 test_commit "update_super" file &&
939 git submodule add ../subsuper_update_r submodule &&
940 git commit -am "submodule" &&
943 rm -rf super_update_r2 &&
944 git clone super_update_r super_update_r2 &&
945 (cd super_update_r2 &&
946 git submodule update --init --recursive >actual &&
947 test_i18ngrep "Submodule path .submodule/subsubmodule.: checked out" actual &&
948 (cd submodule/subsubmodule &&
949 git log > ../../expected
951 (cd .git/modules/submodule/modules/subsubmodule &&
952 git log > ../../../../../actual
954 test_cmp expected actual
958 test_expect_success
'submodule add properly re-creates deeper level submodules' '
960 git reset --hard main &&
962 git submodule add --force ../submodule deeper/submodule
966 test_expect_success
'submodule update properly revives a moved submodule' '
968 H=$(git rev-parse --short HEAD) &&
969 git commit -am "pre move" &&
970 H2=$(git rev-parse --short HEAD) &&
972 sed "s/$H/XXX/" out >expect &&
973 H=$(cd submodule2 && git rev-parse HEAD) &&
974 git rm --cached submodule2 &&
976 mkdir -p "moved/sub module" &&
977 git update-index --add --cacheinfo 160000 $H "moved/sub module" &&
978 git config -f .gitmodules submodule.submodule2.path "moved/sub module" &&
979 git commit -am "post move" &&
980 git submodule update &&
982 sed "s/$H2/XXX/" out >actual &&
983 test_cmp expect actual
987 test_expect_success SYMLINKS
'submodule update can handle symbolic links in pwd' '
988 mkdir -p linked/dir &&
989 ln -s linked/dir linkto &&
991 git clone "$TRASH_DIRECTORY"/super_update_r2 super &&
993 git submodule update --init --recursive
998 test_expect_success
'submodule update clone shallow submodule' '
999 test_when_finished "rm -rf super3" &&
1000 first=$(git -C cloned rev-parse HEAD:submodule) &&
1001 second=$(git -C submodule rev-parse HEAD) &&
1002 commit_count=$(git -C submodule rev-list --count $first^..$second) &&
1003 git clone cloned super3 &&
1007 sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp &&
1008 mv -f .gitmodules.tmp .gitmodules &&
1009 git submodule update --init --depth=$commit_count &&
1010 git -C submodule log --oneline >out &&
1011 test_line_count = 1 out
1015 test_expect_success
'submodule update clone shallow submodule outside of depth' '
1016 test_when_finished "rm -rf super3" &&
1017 git clone cloned super3 &&
1021 sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp &&
1022 mv -f .gitmodules.tmp .gitmodules &&
1023 # Some protocol versions (e.g. 2) support fetching
1024 # unadvertised objects, so restrict this test to v0.
1025 test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \
1026 git submodule update --init --depth=1 2>actual &&
1027 test_i18ngrep "Direct fetching of that commit failed." actual &&
1028 git -C ../submodule config uploadpack.allowReachableSHA1InWant true &&
1029 git submodule update --init --depth=1 >actual &&
1030 git -C submodule log --oneline >out &&
1031 test_line_count = 1 out
1035 test_expect_success
'submodule update --recursive drops module name before recursing' '
1037 (cd deeper/submodule/subsubmodule &&
1040 git submodule update --recursive deeper/submodule >actual &&
1041 test_i18ngrep "Submodule path .deeper/submodule/subsubmodule.: checked out" actual
1045 test_expect_success
'submodule update can be run in parallel' '
1047 GIT_TRACE=$(pwd)/trace.out git submodule update --jobs 7 &&
1048 grep "7 tasks" trace.out &&
1049 git config submodule.fetchJobs 8 &&
1050 GIT_TRACE=$(pwd)/trace.out git submodule update &&
1051 grep "8 tasks" trace.out &&
1052 GIT_TRACE=$(pwd)/trace.out git submodule update --jobs 9 &&
1053 grep "9 tasks" trace.out
1057 test_expect_success
'git clone passes the parallel jobs config on to submodules' '
1058 test_when_finished "rm -rf super4" &&
1059 GIT_TRACE=$(pwd)/trace.out git clone --recurse-submodules --jobs 7 . super4 &&
1060 grep "7 tasks" trace.out &&
1062 git config --global submodule.fetchJobs 8 &&
1063 GIT_TRACE=$(pwd)/trace.out git clone --recurse-submodules . super4 &&
1064 grep "8 tasks" trace.out &&
1066 GIT_TRACE=$(pwd)/trace.out git clone --recurse-submodules --jobs 9 . super4 &&
1067 grep "9 tasks" trace.out &&
1071 test_expect_success
'submodule update --quiet passes quietness to merge/rebase' '
1073 test_commit -C rebasing message &&
1074 git submodule update --rebase --quiet >out 2>err &&
1075 test_must_be_empty out &&
1076 test_must_be_empty err &&
1077 git submodule update --rebase -v >out 2>err &&
1078 test_file_not_empty out &&
1079 test_must_be_empty err
1083 test_expect_success
'submodule update --quiet passes quietness to fetch with a shallow clone' '
1084 test_when_finished "rm -rf super4 super5 super6" &&
1085 git clone . super4 &&
1087 git submodule add --quiet file://"$TRASH_DIRECTORY"/submodule submodule3 &&
1088 git commit -am "setup submodule3"
1091 test_commit line6 file
1093 git clone super4 super5 &&
1095 git submodule update --quiet --init --depth=1 submodule3 >out 2>err &&
1096 test_must_be_empty out &&
1097 test_must_be_empty err
1099 git clone super4 super6 &&
1101 git submodule update --init --depth=1 submodule3 >out 2>err &&
1102 test_file_not_empty out &&
1103 test_file_not_empty err
1107 test_expect_success
'submodule update --filter requires --init' '
1108 test_expect_code 129 git -C super submodule update --filter blob:none
1111 test_expect_success
'submodule update --filter sets partial clone settings' '
1112 test_when_finished "rm -rf super-filter" &&
1113 git clone cloned super-filter &&
1114 git -C super-filter submodule update --init --filter blob:none &&
1115 test_cmp_config -C super-filter/submodule true remote.origin.promisor &&
1116 test_cmp_config -C super-filter/submodule blob:none remote.origin.partialclonefilter