@@ -719,67 +719,4 @@ test_expect_success 'fetch new submodule commit intermittently referenced by sup
719
719
)
720
720
'
721
721
722
- add_commit_push () {
723
- dir=" $1 "
724
- msg=" $2 "
725
- shift 2
726
- git -C " $dir " add " $@ " &&
727
- git -C " $dir " commit -a -m " $msg " &&
728
- git -C " $dir " push
729
- }
730
-
731
- compare_refs_in_dir () {
732
- fail= &&
733
- if test " x$1 " = ' x!'
734
- then
735
- fail=' !' &&
736
- shift
737
- fi &&
738
- git -C " $1 " rev-parse --verify " $2 " > expect &&
739
- git -C " $3 " rev-parse --verify " $4 " > actual &&
740
- eval $fail test_cmp expect actual
741
- }
742
-
743
-
744
- test_expect_success ' setup nested submodule fetch test' '
745
- # does not depend on any previous test setups
746
-
747
- for repo in outer middle inner
748
- do
749
- (
750
- git init --bare $repo &&
751
- git clone $repo ${repo}_content &&
752
- echo "$repo" >"${repo}_content/file" &&
753
- add_commit_push ${repo}_content "initial" file
754
- ) || return 1
755
- done &&
756
-
757
- git clone outer A &&
758
- git -C A submodule add "$pwd/middle" &&
759
- git -C A/middle/ submodule add "$pwd/inner" &&
760
- add_commit_push A/middle/ "adding inner sub" .gitmodules inner &&
761
- add_commit_push A/ "adding middle sub" .gitmodules middle &&
762
-
763
- git clone outer B &&
764
- git -C B/ submodule update --init middle &&
765
-
766
- compare_refs_in_dir A HEAD B HEAD &&
767
- compare_refs_in_dir A/middle HEAD B/middle HEAD &&
768
- test -f B/file &&
769
- test -f B/middle/file &&
770
- ! test -f B/middle/inner/file &&
771
-
772
- echo "change on inner repo of A" >"A/middle/inner/file" &&
773
- add_commit_push A/middle/inner "change on inner" file &&
774
- add_commit_push A/middle "change on inner" inner &&
775
- add_commit_push A "change on inner" middle
776
- '
777
-
778
- test_expect_success ' fetching a superproject containing an uninitialized sub/sub project' '
779
- # depends on previous test for setup
780
-
781
- git -C B/ fetch &&
782
- compare_refs_in_dir A origin/master B origin/master
783
- '
784
-
785
722
test_done
0 commit comments