]> git.ipfire.org Git - thirdparty/git.git/commit
t4104: modernize and simplify quoting
authorMartin Ågren <martin.agren@gmail.com>
Thu, 6 Aug 2020 20:08:54 +0000 (22:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Aug 2020 22:14:34 +0000 (15:14 -0700)
commit289218de2b5cc17e88d7a04f46fc8302142da8d0
treeba954fb045b82c7a991a1e1ec63dd03d5d64e459
parentc76b84a12160476fa795831ef3c2236e68c24f36
t4104: modernize and simplify quoting

Drop whitespace in the value of `$test_description` and in a test body
and use `test_write_lines`.

Stop defining `$u` with a trailing space just so that we can tuck it in
like `git foo $u$more...` and get minimal whitespace in the command:
`git foo $u $more...` is more readable at the "cost" of an empty `$u`
yielding `git foo  something...`.

Finally, avoid using single quotes within the test scripts to repeatedly
close and reopen the quotes that wrap the test scripts (see the previous
commit). This "unnecessary" quoting does mean that the verbose test
output shows the interpolated values, i.e., the shell code we're
running. But the downside is that the source of the script does *not*
show the shell code we're eventually executing, leaving the reader to
reason about what we really do and whether there are any quoting issues.
(There aren't.)

Where we run through loops to generate several "identical but different"
tests, the test message contains the interpolated variables we're
looping on, meaning one can always identify exactly which instance has
failed, even if the verbose test output shows the exact same test body
several times.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4104-apply-boundary.sh