@@ -175,7 +175,7 @@ test_expect_success 'submodule update does not fetch already present commits' '
175
175
git submodule update > ../actual 2> ../actual.err
176
176
) &&
177
177
test_i18ncmp expected actual &&
178
- ! test -s actual.err
178
+ test_must_be_empty actual.err
179
179
'
180
180
181
181
test_expect_success ' submodule update should fail due to local changes' '
@@ -482,7 +482,8 @@ test_expect_success 'recursive submodule update - command in .git/config catches
482
482
483
483
test_expect_success ' submodule init does not copy command into .git/config' '
484
484
(cd super &&
485
- H=$(git ls-files -s submodule | cut -d" " -f2) &&
485
+ git ls-files -s submodule >out &&
486
+ H=$(cut -d" " -f2 out) &&
486
487
mkdir submodule1 &&
487
488
git update-index --add --cacheinfo 160000 $H submodule1 &&
488
489
git config -f .gitmodules submodule.submodule1.path submodule1 &&
@@ -580,9 +581,11 @@ test_expect_success 'submodule update - update=none in .git/config' '
580
581
git checkout master &&
581
582
compare_head
582
583
) &&
583
- git diff --raw | grep " submodule" &&
584
+ git diff --name-only >out &&
585
+ grep ^submodule$ out &&
584
586
git submodule update &&
585
- git diff --raw | grep " submodule" &&
587
+ git diff --name-only >out &&
588
+ grep ^submodule$ out &&
586
589
(cd submodule &&
587
590
compare_head
588
591
) &&
@@ -598,11 +601,13 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
598
601
git checkout master &&
599
602
compare_head
600
603
) &&
601
- git diff --raw | grep " submodule" &&
604
+ git diff --name-only >out &&
605
+ grep ^submodule$ out &&
602
606
git submodule update --checkout &&
603
- test_must_fail git diff --raw \| grep " submodule" &&
607
+ git diff --name-only >out &&
608
+ ! grep ^submodule$ out &&
604
609
(cd submodule &&
605
- test_must_fail compare_head
610
+ ! compare_head
606
611
) &&
607
612
git config --unset submodule.submodule.update
608
613
)
@@ -616,8 +621,8 @@ test_expect_success 'submodule update --init skips submodule with update=none' '
616
621
git clone super cloned &&
617
622
(cd cloned &&
618
623
git submodule update --init &&
619
- test -e submodule/.git &&
620
- test_must_fail test -e none/.git
624
+ test_path_exists submodule/.git &&
625
+ test_path_is_missing none/.git
621
626
)
622
627
'
623
628
@@ -886,7 +891,8 @@ test_expect_success 'submodule update properly revives a moved submodule' '
886
891
H=$(git rev-parse --short HEAD) &&
887
892
git commit -am "pre move" &&
888
893
H2=$(git rev-parse --short HEAD) &&
889
- git status | sed "s/$H/XXX/" >expect &&
894
+ git status >out &&
895
+ sed "s/$H/XXX/" out >expect &&
890
896
H=$(cd submodule2 && git rev-parse HEAD) &&
891
897
git rm --cached submodule2 &&
892
898
rm -rf submodule2 &&
@@ -895,7 +901,8 @@ test_expect_success 'submodule update properly revives a moved submodule' '
895
901
git config -f .gitmodules submodule.submodule2.path "moved/sub module" &&
896
902
git commit -am "post move" &&
897
903
git submodule update &&
898
- git status | sed "s/$H2/XXX/" >actual &&
904
+ git status > out &&
905
+ sed "s/$H2/XXX/" out >actual &&
899
906
test_cmp expect actual
900
907
)
901
908
'
@@ -913,7 +920,7 @@ test_expect_success SYMLINKS 'submodule update can handle symbolic links in pwd'
913
920
914
921
test_expect_success ' submodule update clone shallow submodule' '
915
922
test_when_finished "rm -rf super3" &&
916
- first=$(git -C cloned submodule status submodule |cut -c2-41 ) &&
923
+ first=$(git -C cloned rev-parse HEAD: submodule) &&
917
924
second=$(git -C submodule rev-parse HEAD) &&
918
925
commit_count=$(git -C submodule rev-list --count $first^..$second) &&
919
926
git clone cloned super3 &&
@@ -923,7 +930,8 @@ test_expect_success 'submodule update clone shallow submodule' '
923
930
sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp &&
924
931
mv -f .gitmodules.tmp .gitmodules &&
925
932
git submodule update --init --depth=$commit_count &&
926
- test 1 = $(git -C submodule log --oneline | wc -l)
933
+ git -C submodule log --oneline >out &&
934
+ test_line_count = 1 out
927
935
)
928
936
'
929
937
@@ -939,7 +947,8 @@ test_expect_success 'submodule update clone shallow submodule outside of depth'
939
947
test_i18ngrep "Direct fetching of that commit failed." actual &&
940
948
git -C ../submodule config uploadpack.allowReachableSHA1InWant true &&
941
949
git submodule update --init --depth=1 >actual &&
942
- test 1 = $(git -C submodule log --oneline | wc -l)
950
+ git -C submodule log --oneline >out &&
951
+ test_line_count = 1 out
943
952
)
944
953
'
945
954
0 commit comments