From: Shreyansh Paliwal Date: Mon, 12 Jan 2026 08:21:54 GMT Subject: [RFC PATCH] t5500-fetch-pack.sh: fix suppression of Git exit code in tests Message-ID: <20260112085024.299018-1-shreyanshpaliwalcmsmn@gmail.com> In-Reply-To: > > + test_oid algo >oid_algo && > > + git rev-parse other >oid_other && > > + git rev-parse main >oid_main && > > It is unusual to take these to temporary files. If you want to > reuse the value more than once, it is more common to take them in > variables. Actually I referenced a previous patch [1] where temporary files were used for similar values, so I followed the same pattern here, but I agree that variables would make more sense. > > GIT_PROTOCOL=version=2 git upload-pack . <<-EOF >/dev/null > > 0012command=fetch > > - $(echo "object-format=$(test_oid algo)" | packetize) > > + $(echo "object-format=$( > The construct $( 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. Right, agreed. > In any case, since the output of "echo" is sent to "| packetize", > the exit code of $(test_oid algo) would not affect the bigger > picture, and so would a failure from $( this conversion has any value wrt to "suppression of exit code". If > $( of "| packetize" may exit with non-zero code, but the downstream of > the pipe would hide it. > > THe same comment applies to other two uses of $(