Skip to content

Commit a48fcd8

Browse files
jrngitster
authored andcommitted
tests: add missing &&
Breaks in a test assertion's && chain can potentially hide failures from earlier commands in the chain. Commands intended to fail should be marked with !, test_must_fail, or test_might_fail. The examples in this patch do not require that. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 00648ba commit a48fcd8

File tree

84 files changed

+166
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+166
-166
lines changed

t/annotate-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test_expect_success \
3838
'prepare reference tree' \
3939
'echo "1A quick brown fox jumps over the" >file &&
4040
echo "lazy dog" >>file &&
41-
git add file
41+
git add file &&
4242
GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
4343

4444
test_expect_success \

t/t0003-attributes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test_expect_success 'attribute test' '
5959

6060
test_expect_success 'attribute test: read paths from stdin' '
6161
62-
cat <<EOF > expect
62+
cat <<EOF > expect &&
6363
f: test: f
6464
a/f: test: f
6565
a/c/f: test: f

t/t0024-crlf-archive.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ UNZIP=${UNZIP:-unzip}
77

88
test_expect_success setup '
99
10-
git config core.autocrlf true
10+
git config core.autocrlf true &&
1111
1212
printf "CRLF line ending\r\nAnd another\r\n" > sample &&
1313
git add sample &&
@@ -20,7 +20,7 @@ test_expect_success setup '
2020
test_expect_success 'tar archive' '
2121
2222
git archive --format=tar HEAD |
23-
( mkdir untarred && cd untarred && "$TAR" -xf - )
23+
( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
2424
2525
test_cmp sample untarred/sample
2626

t/t0026-eol-config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_expect_success setup '
1212
1313
git config core.autocrlf false &&
1414
15-
echo "one text" > .gitattributes
15+
echo "one text" > .gitattributes &&
1616
1717
for w in Hello world how are you; do echo $w; done >one &&
1818
for w in I am very very fine thank you; do echo $w; done >two &&

t/t0050-filesystem.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ unibad=
1212
no_symlinks=
1313
test_expect_success 'see what we expect' '
1414
15-
test_case=test_expect_success
16-
test_unicode=test_expect_success
15+
test_case=test_expect_success &&
16+
test_unicode=test_expect_success &&
1717
mkdir junk &&
1818
echo good >junk/CamelCase &&
1919
echo bad >junk/camelcase &&
2020
if test "$(cat junk/CamelCase)" != good
2121
then
22-
test_case=test_expect_failure
22+
test_case=test_expect_failure &&
2323
case_insensitive=t
2424
fi &&
2525
rm -fr junk &&
2626
mkdir junk &&
2727
>junk/"$auml" &&
2828
case "$(cd junk && echo *)" in
2929
"$aumlcdiar")
30-
test_unicode=test_expect_failure
30+
test_unicode=test_expect_failure &&
3131
unibad=t
3232
;;
3333
*) ;;
@@ -36,7 +36,7 @@ test_expect_success 'see what we expect' '
3636
{
3737
ln -s x y 2> /dev/null &&
3838
test -h y 2> /dev/null ||
39-
no_symlinks=1
39+
no_symlinks=1 &&
4040
rm -f y
4141
}
4242
'
@@ -128,7 +128,7 @@ test_expect_success "setup unicode normalization tests" '
128128
cd unicode &&
129129
touch "$aumlcdiar" &&
130130
git add "$aumlcdiar" &&
131-
git commit -m initial
131+
git commit -m initial &&
132132
git tag initial &&
133133
git checkout -b topic &&
134134
git mv $aumlcdiar tmp &&

t/t1000-read-tree-m-3way.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ test_expect_success \
309309
test_expect_success \
310310
'6 - must not exist in O && !A && !B case' "
311311
rm -f .git/index DD &&
312-
echo DD >DD
312+
echo DD >DD &&
313313
git update-index --add DD &&
314314
test_must_fail git read-tree -m $tree_O $tree_A $tree_B
315315
"

t/t1001-read-tree-m-2way.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ test_expect_success '-m references the correct modified tree' '
394394
echo >file-a &&
395395
echo >file-b &&
396396
git add file-a file-b &&
397-
git commit -a -m "test for correct modified tree"
397+
git commit -a -m "test for correct modified tree" &&
398398
git branch initial-mod &&
399399
echo b >file-b &&
400400
git commit -a -m "B" &&

t/t1011-read-tree-sparse-checkout.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ test_expect_success 'read-tree without .git/info/sparse-checkout' '
4747
'
4848

4949
test_expect_success 'read-tree with .git/info/sparse-checkout but disabled' '
50-
echo >.git/info/sparse-checkout
50+
echo >.git/info/sparse-checkout &&
5151
git read-tree -m -u HEAD &&
5252
git ls-files -t >result &&
5353
test_cmp expected.swt result &&

t/t1200-tutorial.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test_expect_success 'git diff' '
4242
'
4343

4444
test_expect_success 'tree' '
45-
tree=$(git write-tree 2>/dev/null)
45+
tree=$(git write-tree 2>/dev/null) &&
4646
test 8988da15d077d4829fc51d8544c097def6644dbb = $tree
4747
'
4848

t/t1302-repo-version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test_expect_success 'gitdir selection on unsupported repo' '
3939
(
4040
cd test2 &&
4141
git config core.repositoryformatversion >../actual
42-
)
42+
) &&
4343
test_cmp expect actual
4444
'
4545

0 commit comments

Comments
 (0)