tests: fix broken &&-chains in compound statements
commit74d2f5695dab4454097b2d1693f7206e8328724a
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 9 Dec 2021 05:11:06 +0000 (9 00:11 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2021 18:29:48 +0000 (13 10:29 -0800)
tree6d4a147a909ef45477fd1509e83530b7ed39bec9
parent0849541268a3aca9381591aed87b6864a203709b
tests: fix broken &&-chains in compound statements

The top-level &&-chain checker built into t/test-lib.sh causes tests to
magically exit with code 117 if the &&-chain is broken. However, it has
the shortcoming that the magic does not work within `{...}` groups,
`(...)` subshells, `$(...)` substitutions, or within bodies of compound
statements, such as `if`, `for`, `while`, `case`, etc. `chainlint.sed`
partly fills in the gap by catching broken &&-chains in `(...)`
subshells, but bugs can still lurk behind broken &&-chains in the other
cases.

Fix broken &&-chains in compound statements in order to reduce the
number of possible lurking bugs.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
28 files changed:
t/perf/p0005-status.sh
t/perf/p0006-read-tree-checkout.sh
t/perf/p0007-write-cache.sh
t/perf/p5302-pack-index.sh
t/perf/p5303-many-packs.sh
t/t1050-large.sh
t/t1300-config.sh
t/t1700-split-index.sh
t/t2200-add-update.sh
t/t3070-wildmatch.sh
t/t3700-add.sh
t/t4046-diff-unmerged.sh
t/t4123-apply-shrink.sh
t/t4138-apply-ws-expansion.sh
t/t5302-pack-index.sh
t/t5317-pack-objects-filter-objects.sh
t/t5571-pre-push-hook.sh
t/t5616-partial-clone.sh
t/t6005-rev-list-count.sh
t/t6009-rev-list-parent.sh
t/t6112-rev-list-filters-objects.sh
t/t6120-describe.sh
t/t6407-merge-binary.sh
t/t6412-merge-large-rename.sh
t/t7004-tag.sh
t/t7519-status-fsmonitor.sh
t/t7602-merge-octopus-many.sh
t/t9130-git-svn-authors-file.sh