Re: [PATCH 05/16] t2018: don't lose return code of git commands
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 27, 2019, 21:42 UTC
- Message-ID
- <CAPig+cQmO2W7kcqWZwrSsC7-vkk_UVcC5NktY+0dddcyaegr6Q@mail.gmail.com>
- In-Reply-To
- <4fe247c09df89ebe908f366ee7c2a4ec1c209d86.1577454401.git.liu.denton@gmail.com>
On Fri, Dec 27, 2019 at 8:48 AM Denton Liu <liu.denton@gmail.com> 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...
Show 8 quoted lines
> Signed-off-by: Denton Liu <liu.denton@gmail.com>
> ---
> diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh
> @@ -23,7 +23,8 @@ do_checkout () {
> # if <sha> 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.