Re: [RFC PATCH] t5500-fetch-pack.sh: fix suppression of Git exit code in tests
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 12, 2026, 13:25 UTC
- Message-ID
- <xmqqpl7fnetj.fsf@gitster.g>
- In-Reply-To
- <aWSv8dlt32xg14e1@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 17 quoted lines
> On Sun, Jan 11, 2026 at 02:50:37PM -0800, Junio C Hamano wrote: >> Shreyansh Paliwal <shreyanshpaliwalcmsmn@gmail.com> writes: >> > GIT_PROTOCOL=version=2 git upload-pack . <<-EOF >/dev/null >> > 0012command=fetch >> > - $(echo "object-format=$(test_oid algo)" | packetize) >> > + $(echo "object-format=$(<oid_algo)" | packetize) >> >> The construct $(<file) is bashism, that does not work if your shell >> is not bash, isn't it? If you used a variable, e.g., >> >> $(echo "object-format=$oid_algo" | packetize) >> >> that would make the result more portable. > > There's no need for the echo at all as this can also be written as: > > packetize "object-format=$oid_algo"
Yeah, I failed to realize that this is a(n unnecessarily) convoluted use of command substitution inside HERE-DOC. What mushroom were we on when we originally wrote this crap, I have to wonder ;-)?
Thanks for spotting it.