From: Eric Sunshine Date: Fri, 27 Dec 2019 21:42:53 GMT Subject: Re: [PATCH 05/16] t2018: don't lose return code of git commands Message-ID: In-Reply-To: <4fe247c09df89ebe908f366ee7c2a4ec1c209d86.1577454401.git.liu.denton@gmail.com> On Fri, Dec 27, 2019 at 8:48 AM Denton Liu wrote: > We had some git commands wrapped in non-assignment command substitutions > which would result in their return codes to be lost. Rewrite these > instances so that their return codes are now checked. Try writing your commit messages in imperative mood: Fix invocations of Git commands so their exit codes are not lost within command substitutions... or something. Same comment about several other commit messages in this series. More below... > Signed-off-by: Denton Liu > --- > diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh > @@ -23,7 +23,8 @@ do_checkout () { > # if is not specified, use HEAD. > - exp_sha=${2:-$(git rev-parse --verify HEAD)} && > + head=$(git rev-parse --verify HEAD) && > + exp_sha=${2:-$head} && Are you sure this transformation is needed? In my tests, the exit code of the Git command is not lost.