Re: [PATCH v3 0/3] Unify trailers formatting logic for pretty.c and ref-filter.c
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 7, 2021, 03:33 UTC
- Message-ID
- <xmqqim74a6x1.fsf@gitster.c.googlers.com>
- In-Reply-To
- <pull.726.v3.git.1612602945.gitgitgadget@gmail.com>
"Hariom Verma via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> @@ t/t6300-for-each-ref.sh: test_expect_success '%(trailers:only) and %(trailers:un > + option="$2" > + expect="$3" > + test_expect_success "$title" ' > -+ echo $expect >expect && > ++ printf "$expect\n" >expect &&
Are we sure that "$expect" would not ever have any '%' in it, to confuse printf? To be future-proof and safe, it would be prudent to instead use
printf "%s\n" "$expect"
to make sure that whatever is passed in $3 gets output LITERALLY.
The callers need to adopt the change I gave you in the review of the previous round so that they do not assume backslash-en will by changed to LF by somebody---instead if they mean LF, they just say LF.
Thanks.