Skip to content

Commit bdbc17e

Browse files
matvoregitster
authored andcommitted
tests: standardize pipe placement
Instead of using a line-continuation and pipe on the second line, take advantage of the shell's implicit line continuation after a pipe character. So for example, instead of some long line \ | next line use some long line | next line And add a blank line before and after the pipe where it aids readability (it usually does). This better matches the coding style documented in Documentation/CodingGuidelines and used in shell scripts elsewhere in the tree. Signed-off-by: Matthew DeVore <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a378fee commit bdbc17e

7 files changed

+344
-250
lines changed

t/lib-gpg.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,12 @@ then
5757
echo | gpgsm --homedir "${GNUPGHOME}" 2>/dev/null \
5858
--passphrase-fd 0 --pinentry-mode loopback \
5959
--import "$TEST_DIRECTORY"/lib-gpg/gpgsm_cert.p12 &&
60-
gpgsm --homedir "${GNUPGHOME}" 2>/dev/null -K \
61-
| grep fingerprint: | cut -d" " -f4 | tr -d '\n' > \
62-
${GNUPGHOME}/trustlist.txt &&
60+
61+
gpgsm --homedir "${GNUPGHOME}" 2>/dev/null -K |
62+
grep fingerprint: |
63+
cut -d" " -f4 |
64+
tr -d '\n' >"${GNUPGHOME}/trustlist.txt" &&
65+
6366
echo " S relax" >> ${GNUPGHOME}/trustlist.txt &&
6467
(gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) &&
6568
echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \

t/t1006-cat-file.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ test_expect_success "--batch-check for a non-existent hash" '
218218
test "0000000000000000000000000000000000000042 missing
219219
0000000000000000000000000000000000000084 missing" = \
220220
"$( ( echo 0000000000000000000000000000000000000042;
221-
echo_without_newline 0000000000000000000000000000000000000084; ) \
222-
| git cat-file --batch-check)"
221+
echo_without_newline 0000000000000000000000000000000000000084; ) |
222+
git cat-file --batch-check)"
223223
'
224224

225225
test_expect_success "--batch for an existent and a non-existent hash" '
226226
test "$tag_sha1 tag $tag_size
227227
$tag_content
228228
0000000000000000000000000000000000000000 missing" = \
229229
"$( ( echo $tag_sha1;
230-
echo_without_newline 0000000000000000000000000000000000000000; ) \
231-
| git cat-file --batch)"
230+
echo_without_newline 0000000000000000000000000000000000000000; ) |
231+
git cat-file --batch)"
232232
'
233233

234234
test_expect_success "--batch-check for an empty line" '

t/t1300-config.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,8 +1770,9 @@ test_expect_success '--show-origin stdin with file include' '
17701770
cat >expect <<-EOF &&
17711771
file:$INCLUDE_DIR/stdin.include include
17721772
EOF
1773-
echo "[include]path=\"$INCLUDE_DIR\"/stdin.include" \
1774-
| git config --show-origin --includes --file - user.stdin >output &&
1773+
echo "[include]path=\"$INCLUDE_DIR\"/stdin.include" |
1774+
git config --show-origin --includes --file - user.stdin >output &&
1775+
17751776
test_cmp expect output
17761777
'
17771778

0 commit comments

Comments
 (0)