Re: [PATCH 05/16] t2018: don't lose return code of git commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 27, 2019 at 8:48 AM Denton Liu <liu.denton@xxxxxxxxx> 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 <liu.denton@xxxxxxxxx>
> ---
> 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.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux