summaryrefslogtreecommitdiff
path: root/t/t5526-fetch-submodules.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-27 21:33:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-27 21:33:43 (GMT)
commit986c5181071ce3aac42d0aaeb7bd691a1a0bdf4a (patch)
tree4ef3f9805cfdbf3b4496cb720a94c138df034204 /t/t5526-fetch-submodules.sh
parentfc0df933c8fa09603a9e9798085ee07ca1a83f65 (diff)
parent1c5e94f459a0b7c23ef7e855441a65afdc4effab (diff)
downloadgit-986c5181071ce3aac42d0aaeb7bd691a1a0bdf4a.zip
git-986c5181071ce3aac42d0aaeb7bd691a1a0bdf4a.tar.gz
git-986c5181071ce3aac42d0aaeb7bd691a1a0bdf4a.tar.bz2
Merge branch 'sg/test-must-be-empty'
Test fixes. * sg/test-must-be-empty: tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>' tests: use 'test_must_be_empty' instead of 'test_cmp /dev/null <out>' tests: use 'test_must_be_empty' instead of 'test ! -s' tests: use 'test_must_be_empty' instead of '! test -s'
Diffstat (limited to 't/t5526-fetch-submodules.sh')
-rwxr-xr-xt/t5526-fetch-submodules.sh45
1 files changed, 22 insertions, 23 deletions
diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
index 0f730d7..6c2f9b2 100755
--- a/t/t5526-fetch-submodules.sh
+++ b/t/t5526-fetch-submodules.sh
@@ -98,8 +98,8 @@ test_expect_success "fetch alone only fetches superproject" '
cd downstream &&
git fetch >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
@@ -107,8 +107,8 @@ test_expect_success "fetch --no-recurse-submodules only fetches superproject" '
cd downstream &&
git fetch --no-recurse-submodules >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
@@ -127,8 +127,8 @@ test_expect_success "--no-recurse-submodules overrides .gitmodules config" '
cd downstream &&
git fetch --no-recurse-submodules >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides setting in .gitmodules" '
@@ -137,8 +137,8 @@ test_expect_success "using fetchRecurseSubmodules=false in .git/config overrides
git config submodule.submodule.fetchRecurseSubmodules false &&
git fetch >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config" '
@@ -157,8 +157,8 @@ test_expect_success "--quiet propagates to submodules" '
cd downstream &&
git fetch --recurse-submodules --quiet >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "--quiet propagates to parallel submodules" '
@@ -166,8 +166,8 @@ test_expect_success "--quiet propagates to parallel submodules" '
cd downstream &&
git fetch --recurse-submodules -j 2 --quiet >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "--dry-run propagates to submodules" '
@@ -221,8 +221,8 @@ test_expect_success "--no-recurse-submodules overrides config setting" '
git config fetch.recurseSubmodules true &&
git fetch --no-recurse-submodules >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "Recursion doesn't happen when no new commits are fetched in the superproject" '
@@ -235,8 +235,8 @@ test_expect_success "Recursion doesn't happen when no new commits are fetched in
git config --unset fetch.recurseSubmodules &&
git fetch >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "Recursion stops when no new submodule commits are fetched" '
@@ -268,7 +268,7 @@ test_expect_success "Recursion doesn't happen when new superproject commits don'
cd downstream &&
git fetch >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
+ test_must_be_empty actual.out &&
test_i18ncmp expect.err.file actual.err
'
@@ -357,8 +357,8 @@ test_expect_success "'--recurse-submodules=on-demand' doesn't recurse when no ne
git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err &&
git config --unset fetch.recurseSubmodules
) &&
- ! test -s actual.out &&
- ! test -s actual.err
+ test_must_be_empty actual.out &&
+ test_must_be_empty actual.err
'
test_expect_success "'--recurse-submodules=on-demand' recurses as deep as necessary (and ignores config)" '
@@ -402,7 +402,7 @@ test_expect_success "'--recurse-submodules=on-demand' stops when no new submodul
cd downstream &&
git fetch --recurse-submodules=on-demand >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
+ test_must_be_empty actual.out &&
test_i18ncmp expect.err.file actual.err
'
@@ -477,7 +477,7 @@ test_expect_success "don't fetch submodule when newly recorded commits are alrea
cd downstream &&
git fetch >../actual.out 2>../actual.err
) &&
- ! test -s actual.out &&
+ test_must_be_empty actual.out &&
test_i18ncmp expect.err actual.err &&
(
cd submodule &&
@@ -495,7 +495,6 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
git add submodule &&
git rm .gitmodules &&
git commit -m "new submodule without .gitmodules" &&
- printf "" >expect.out &&
head2=$(git rev-parse --short HEAD) &&
echo "From $pwd/." >expect.err.2 &&
echo " $head1..$head2 master -> origin/master" >>expect.err.2 &&
@@ -514,7 +513,7 @@ test_expect_success "'fetch.recurseSubmodules=on-demand' works also without .git
git config --unset fetch.recurseSubmodules &&
git reset --hard
) &&
- test_i18ncmp expect.out actual.out &&
+ test_must_be_empty actual.out &&
test_i18ncmp expect.err.2 actual.err &&
git checkout HEAD^ -- .gitmodules &&
git add .gitmodules &&