Skip to content

Commit 4f4b184

Browse files
committed
Merge branch 'es/test-chain-lint'
Broken &&-chains in the test scripts have been corrected. * es/test-chain-lint: t6000-t9999: detect and signal failure within loop t5000-t5999: detect and signal failure within loop t4000-t4999: detect and signal failure within loop t0000-t3999: detect and signal failure within loop tests: simplify by dropping unnecessary `for` loops tests: apply modern idiom for exiting loop upon failure tests: apply modern idiom for signaling test failure tests: fix broken &&-chains in `{...}` groups tests: fix broken &&-chains in `$(...)` command substitutions tests: fix broken &&-chains in compound statements tests: use test_write_lines() to generate line-oriented output tests: simplify construction of large blocks of text t9107: use shell parameter expansion to avoid breaking &&-chain t6300: make `%(raw:size) --shell` test more robust t5516: drop unnecessary subshell and command invocation t4202: clarify intent by creating expected content less cleverly t1020: avoid aborting entire test script when one test fails t1010: fix unnoticed failure on Windows t/lib-pager: use sane_unset() to avoid breaking &&-chain
2 parents 0dc90d9 + 0c51d6b commit 4f4b184

File tree

163 files changed

+740
-847
lines changed

Some content is hidden

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

163 files changed

+740
-847
lines changed

contrib/mw-to-git/t/t9365-continuing-queries.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_expect_success 'creating page w/ >500 revisions' '
1212
for i in $(test_seq 501)
1313
do
1414
echo "creating revision $i" &&
15-
wiki_editpage foo "revision $i<br/>" true
15+
wiki_editpage foo "revision $i<br/>" true || return 1
1616
done
1717
'
1818

contrib/subtree/t/t7900-subtree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ test_expect_success 'subtree descendant check' '
14451445
) &&
14461446
test_create_commit "$test_count" folder_subtree/0 &&
14471447
test_create_commit "$test_count" folder_subtree/b &&
1448-
cherry=$(cd "$test_count"; git rev-parse HEAD) &&
1448+
cherry=$(cd "$test_count" && git rev-parse HEAD) &&
14491449
(
14501450
cd "$test_count" &&
14511451
git checkout branch

t/annotate-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ test_expect_success 'blame huge graft' '
161161
GIT_AUTHOR_NAME=$i$j [email protected] \
162162
git commit -a -m "$i$j" &&
163163
commit=$(git rev-parse --verify HEAD) &&
164-
graft="$graft$commit "
164+
graft="$graft$commit " || return 1
165165
done
166166
done &&
167167
printf "%s " $graft >.git/info/grafts &&

t/lib-pager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
test_expect_success 'determine default pager' '
44
test_might_fail git config --unset core.pager &&
55
less=$(
6-
unset PAGER GIT_PAGER;
6+
sane_unset PAGER GIT_PAGER &&
77
git var GIT_PAGER
88
) &&
99
test -n "$less"

t/perf/p0005-status.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ test_perf_default_repo
2424
test_expect_success "setup repo" '
2525
if git rev-parse --verify refs/heads/p0006-ballast^{commit}
2626
then
27-
echo Assuming synthetic repo from many-files.sh
28-
git branch br_base master
29-
git branch br_ballast p0006-ballast
30-
git config --local core.sparsecheckout 1
27+
echo Assuming synthetic repo from many-files.sh &&
28+
git branch br_base master &&
29+
git branch br_ballast p0006-ballast &&
30+
git config --local core.sparsecheckout 1 &&
3131
cat >.git/info/sparse-checkout <<-EOF
3232
/*
3333
!ballast/*
3434
EOF
3535
else
36-
echo Assuming non-synthetic repo...
37-
git branch br_base $(git rev-list HEAD | tail -n 1)
36+
echo Assuming non-synthetic repo... &&
37+
git branch br_base $(git rev-list HEAD | tail -n 1) &&
3838
git branch br_ballast HEAD
3939
fi &&
4040
git checkout -q br_ballast &&

t/perf/p0006-read-tree-checkout.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ test_perf_default_repo
2424
test_expect_success "setup repo" '
2525
if git rev-parse --verify refs/heads/p0006-ballast^{commit}
2626
then
27-
echo Assuming synthetic repo from many-files.sh
28-
git branch br_base master
29-
git branch br_ballast p0006-ballast^
30-
git branch br_ballast_alias p0006-ballast^
31-
git branch br_ballast_plus_1 p0006-ballast
32-
git config --local core.sparsecheckout 1
27+
echo Assuming synthetic repo from many-files.sh &&
28+
git branch br_base master &&
29+
git branch br_ballast p0006-ballast^ &&
30+
git branch br_ballast_alias p0006-ballast^ &&
31+
git branch br_ballast_plus_1 p0006-ballast &&
32+
git config --local core.sparsecheckout 1 &&
3333
cat >.git/info/sparse-checkout <<-EOF
3434
/*
3535
!ballast/*
3636
EOF
3737
else
38-
echo Assuming non-synthetic repo...
39-
git branch br_base $(git rev-list HEAD | tail -n 1)
40-
git branch br_ballast HEAD^ || error "no ancestor commit from current head"
41-
git branch br_ballast_alias HEAD^
38+
echo Assuming non-synthetic repo... &&
39+
git branch br_base $(git rev-list HEAD | tail -n 1) &&
40+
git branch br_ballast HEAD^ || error "no ancestor commit from current head" &&
41+
git branch br_ballast_alias HEAD^ &&
4242
git branch br_ballast_plus_1 HEAD
4343
fi &&
4444
git checkout -q br_ballast &&

t/perf/p0007-write-cache.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ test_perf_default_repo
99
test_expect_success "setup repo" '
1010
if git rev-parse --verify refs/heads/p0006-ballast^{commit}
1111
then
12-
echo Assuming synthetic repo from many-files.sh
13-
git config --local core.sparsecheckout 1
12+
echo Assuming synthetic repo from many-files.sh &&
13+
git config --local core.sparsecheckout 1 &&
1414
cat >.git/info/sparse-checkout <<-EOF
1515
/*
1616
!ballast/*

t/perf/p0100-globbing.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ test_expect_success 'setup' '
1919
printf "a" >>refname &&
2020
for j in $(test_seq 1 $i)
2121
do
22-
printf "a*" >>refglob.$i
22+
printf "a*" >>refglob.$i || return 1
2323
done &&
24-
echo b >>refglob.$i
24+
echo b >>refglob.$i || return 1
2525
done &&
2626
test_commit test $(cat refname).t "" $(cat refname).t
2727
'

t/perf/p1400-update-ref.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test_expect_success "setup" '
1313
do
1414
printf "start\ncreate refs/heads/%d PRE\ncommit\n" $i &&
1515
printf "start\nupdate refs/heads/%d POST PRE\ncommit\n" $i &&
16-
printf "start\ndelete refs/heads/%d POST\ncommit\n" $i
16+
printf "start\ndelete refs/heads/%d POST\ncommit\n" $i || return 1
1717
done >instructions
1818
'
1919

@@ -22,7 +22,7 @@ test_perf "update-ref" '
2222
do
2323
git update-ref refs/heads/branch PRE &&
2424
git update-ref refs/heads/branch POST PRE &&
25-
git update-ref -d refs/heads/branch
25+
git update-ref -d refs/heads/branch || return 1
2626
done
2727
'
2828

t/perf/p1451-fsck-skip-list.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test_expect_success "setup $n bad commits" '
1515
echo "committer C <[email protected]> 1234567890 +0000" &&
1616
echo "data <<EOF" &&
1717
echo "$i.Q." &&
18-
echo "EOF"
18+
echo "EOF" || return 1
1919
done | q_to_nul | git fast-import
2020
'
2121

0 commit comments

Comments
 (0)