diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-01-03 16:24:15 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-01-03 16:24:15 -0800 |
| commit | 4f4b18497aea75425506097de7225df8c7cf5c66 (patch) | |
| tree | 894010237b6188081699ace29bf5796f42bd4362 /t/t4014-format-patch.sh | |
| parent | 0dc90d954db852c6604796b8d817365f94e92a16 (diff) | |
| parent | 0c51d6b4aec9f1959d148960cb55155b676cec78 (diff) | |
| download | git-4f4b18497aea75425506097de7225df8c7cf5c66.tar.xz | |
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
Diffstat (limited to 't/t4014-format-patch.sh')
| -rwxr-xr-x | t/t4014-format-patch.sh | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 712d4b5ddf..7dc5a5c736 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -12,25 +12,25 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . "$TEST_DIRECTORY"/lib-terminal.sh test_expect_success setup ' - for i in 1 2 3 4 5 6 7 8 9 10; do echo "$i"; done >file && + test_write_lines 1 2 3 4 5 6 7 8 9 10 >file && cat file >elif && git add file elif && test_tick && git commit -m Initial && git checkout -b side && - for i in 1 2 5 6 A B C 7 8 9 10; do echo "$i"; done >file && + test_write_lines 1 2 5 6 A B C 7 8 9 10 >file && test_chmod +x elif && test_tick && git commit -m "Side changes #1" && - for i in D E F; do echo "$i"; done >>file && + test_write_lines D E F >>file && git update-index file && test_tick && git commit -m "Side changes #2" && git tag C2 && - for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >file && + test_write_lines 5 6 1 2 3 A 4 B C 7 8 9 10 D E F >file && git update-index file && test_tick && git commit -m "Side changes #3 with \\n backslash-n in it." && @@ -43,18 +43,18 @@ test_expect_success setup ' git checkout side && git checkout -b patchid && - for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >file2 && - for i in 1 2 3 A 4 B C 7 8 9 10 D E F 5 6; do echo "$i"; done >file3 && - for i in 8 9 10; do echo "$i"; done >file && + test_write_lines 5 6 1 2 3 A 4 B C 7 8 9 10 D E F >file2 && + test_write_lines 1 2 3 A 4 B C 7 8 9 10 D E F 5 6 >file3 && + test_write_lines 8 9 10 >file && git add file file2 file3 && test_tick && git commit -m "patchid 1" && - for i in 4 A B 7 8 9 10; do echo "$i"; done >file2 && - for i in 8 9 10 5 6; do echo "$i"; done >file3 && + test_write_lines 4 A B 7 8 9 10 >file2 && + test_write_lines 8 9 10 5 6 >file3 && git add file2 file3 && test_tick && git commit -m "patchid 2" && - for i in 10 5 6; do echo "$i"; done >file && + test_write_lines 10 5 6 >file && git add file && test_tick && git commit -m "patchid 3" && @@ -325,7 +325,7 @@ test_expect_success 'filename length limit' ' max=$( for patch in 000[1-9]-*.patch do - echo "$patch" | wc -c + echo "$patch" | wc -c || exit 1 done | sort -nr | head -n 1 @@ -343,7 +343,7 @@ test_expect_success 'filename length limit from config' ' max=$( for patch in 000[1-9]-*.patch do - echo "$patch" | wc -c + echo "$patch" | wc -c || exit 1 done | sort -nr | head -n 1 @@ -361,7 +361,7 @@ test_expect_success 'filename limit applies only to basename' ' max=$( for patch in patches/000[1-9]-*.patch do - echo "${patch#patches/}" | wc -c + echo "${patch#patches/}" | wc -c || exit 1 done | sort -nr | head -n 1 @@ -653,7 +653,7 @@ test_expect_success 'excessive subject' ' git checkout side && before=$(git hash-object file) && before=$(git rev-parse --short $before) && - for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >>file && + test_write_lines 5 6 1 2 3 A 4 B C 7 8 9 10 D E F >>file && after=$(git hash-object file) && after=$(git rev-parse --short $after) && git update-index file && @@ -1086,7 +1086,7 @@ test_expect_success TTY 'format-patch --stdout paginates' ' test_expect_success 'format-patch handles multi-line subjects' ' rm -rf patches/ && echo content >>file && - for i in one two three; do echo $i; done >msg && + test_write_lines one two three >msg && git add file && git commit -F msg && git format-patch -o patches -1 && @@ -1098,7 +1098,7 @@ test_expect_success 'format-patch handles multi-line subjects' ' test_expect_success 'format-patch handles multi-line encoded subjects' ' rm -rf patches/ && echo content >>file && - for i in en två tre; do echo $i; done >msg && + test_write_lines en två tre >msg && git add file && git commit -F msg && git format-patch -o patches -1 && |
