t: convert some here-doc test bodies
commitf6b75726b2779faa57bd590deb882d3da157f3be
authorJeff King <peff@peff.net>
Wed, 10 Jul 2024 08:39:31 +0000 (10 04:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Jul 2024 17:14:23 +0000 (10 10:14 -0700)
treea849b3cd688bd616be98f645fa4ea136d7f2fe10
parent1d133ae91f7dd5cc6ccd0137a175372460383235
t: convert some here-doc test bodies

The t1404 script checks a lot of output from Git which contains single
quotes. Because the test snippets are themselves wrapped in the same
single-quotes, we have to resort to using $SQ to match them.  This is
error-prone and makes the tests harder to read.

Instead, let's use the new here-doc feature added in the previous
commit, which lets us write anything in the test body we want (except
the here-doc end marker on a line by itself, of course).

Note that we do use "\" in our marker to avoid interpolation (which is
the whole point). But we don't use "<<-", as we want to preserve
whitespace in the snippet (and running with "-v" before and after shows
that we produce the exact same output, except with the ugly $SQ
references fixed).

I just converted every test here, even though only some of them use
$SQ. But it would be equally correct to mix-and-match styles if we don't
mind the inconsistency.

I've also converted a few tests in t0600 which were moved from t1404 (I
had written this patch before they were moved, but it seemed worth
porting over the changes rather than losing them).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t0600-reffiles-backend.sh
t/t1404-update-ref-errors.sh