Skip to content
  • Martin Ågren's avatar
    t4104: modernize and simplify quoting · 289218de
    Martin Ågren authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    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: default avatarMartin Ågren <martin.agren@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    289218de