diff options
author | Eric Sunshine <sunshine@sunshineco.com> | 2021-12-09 08:11:06 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-13 21:29:48 +0300 |
commit | 74d2f5695dab4454097b2d1693f7206e8328724a (patch) | |
tree | 6d4a147a909ef45477fd1509e83530b7ed39bec9 /t/t5616-partial-clone.sh | |
parent | 0849541268a3aca9381591aed87b6864a203709b (diff) |
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>
Diffstat (limited to 't/t5616-partial-clone.sh')
-rwxr-xr-x | t/t5616-partial-clone.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index cf3e82bdf5..23c156e399 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -16,9 +16,9 @@ test_expect_success 'setup normal src repo' ' git init src && for n in 1 2 3 4 do - echo "This is file: $n" > src/file.$n.txt - git -C src add file.$n.txt - git -C src commit -m "file $n" + echo "This is file: $n" > src/file.$n.txt && + git -C src add file.$n.txt && + git -C src commit -m "file $n" && git -C src ls-files -s file.$n.txt >>temp done && awk -f print_2.awk <temp | sort >expect_1.oids && @@ -72,8 +72,8 @@ test_expect_success 'push new commits to server' ' git -C src remote add srv "file://$(pwd)/srv.bare" && for x in a b c d e do - echo "Mod file.1.txt $x" >>src/file.1.txt - git -C src add file.1.txt + echo "Mod file.1.txt $x" >>src/file.1.txt && + git -C src add file.1.txt && git -C src commit -m "mod $x" done && git -C src blame main -- file.1.txt >expect.blame && @@ -114,8 +114,8 @@ test_expect_success 'verify blame causes dynamic object fetch' ' test_expect_success 'push new commits to server for file.2.txt' ' for x in a b c d e f do - echo "Mod file.2.txt $x" >>src/file.2.txt - git -C src add file.2.txt + echo "Mod file.2.txt $x" >>src/file.2.txt && + git -C src add file.2.txt && git -C src commit -m "mod $x" done && git -C src push -u srv main @@ -135,8 +135,8 @@ test_expect_success 'override inherited filter-spec using --no-filter' ' test_expect_success 'push new commits to server for file.3.txt' ' for x in a b c d e f do - echo "Mod file.3.txt $x" >>src/file.3.txt - git -C src add file.3.txt + echo "Mod file.3.txt $x" >>src/file.3.txt && + git -C src add file.3.txt && git -C src commit -m "mod $x" done && git -C src push -u srv main |