t6300: make `%(raw:size) --shell` test more robust
commitefe47c83b266b3ca12d646f5a8f1c6a71f0d6e44
authorEric Sunshine <sunshine@sunshineco.com>
Thu, 9 Dec 2021 05:11:02 +0000 (9 00:11 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Dec 2021 18:29:48 +0000 (13 10:29 -0800)
tree71ec34e5efff98c788d139e583c962e25eeee9dc
parente57ea501d00eab6191993f35e502aface5ceac5e
t6300: make `%(raw:size) --shell` test more robust

This test populates its `expect` file solely by appending content but
fails to ensure that the file starts out empty. The test succeeds only
because no earlier test populated a file of the exact same name, however
this is an accident waiting to happen. Make the test more robust by
ensuring that it contains exactly the intended content.

While at it, simplify the implementation via a straightforward `sed`
application and by avoiding dropping out of the single-quote context
within the test body (thus eliminating a hard-to-digest combination of
apostrophes and backslashes).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6300-for-each-ref.sh