Re: [PATCH] t6423: fix suppression of Git’s exit code in tests

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

 



On Sun, 2 Feb 2025 at 17:40, ayu-ch <ayu.chandekar@xxxxxxxxx> wrote:
>
> From: Ayush Chandekar <ayu.chandekar@xxxxxxxxx>
>
> Some test in t6423 supress Git's exit code, which can cause test
s/supress/suppress
> failures go unnoticed. Specifically using git <subcommand> |
> <other-command> masks potential failures of the Git command.
>
> This commit ensures that Git's exit status is correctly propogated by:
> - Avoiding pipes that suppress exit codes.
s/propogated/propagated
The commit message should be in imperative mood (cf.
Documentation/SubmittingPatches)
>
> Signed-off-by: Ayush Chandekar <ayu.chandekar@xxxxxxxxx>
> ---
>  t/t6423-merge-rename-directories.sh | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/t/t6423-merge-rename-directories.sh b/t/t6423-merge-rename-directories.sh
> index 88d1cf2cde..94080c65d1 100755
> --- a/t/t6423-merge-rename-directories.sh
> +++ b/t/t6423-merge-rename-directories.sh
> @@ -5071,7 +5071,8 @@ test_expect_success '12i: Directory rename causes rename-to-self' '
>                 test_path_is_file source/bar &&
>                 test_path_is_file source/baz &&
>
> -               git ls-files | uniq >tracked &&
> +               git ls-files >actual &&
> +               uniq <actual >tracked &&
>                 test_line_count = 3 tracked &&
>
>                 git status --porcelain -uno >actual &&
> @@ -5129,7 +5130,8 @@ test_expect_success '12j: Directory rename to root causes rename-to-self' '
>                 test_path_is_file bar &&
>                 test_path_is_file baz &&
>
> -               git ls-files | uniq >tracked &&
> +               git ls-files >actual &&
> +               uniq <actual >tracked &&
>                 test_line_count = 3 tracked &&
>
>                 git status --porcelain -uno >actual &&
> @@ -5187,7 +5189,8 @@ test_expect_success '12k: Directory rename with sibling causes rename-to-self' '
>                 test_path_is_file dirA/bar &&
>                 test_path_is_file dirA/baz &&
>
> -               git ls-files | uniq >tracked &&
> +               git ls-files >actual &&
> +               uniq <actual >tracked &&
>                 test_line_count = 3 tracked &&
>
>                 git status --porcelain -uno >actual &&
> --
> 2.48.GIT
>
>
It should’ve been v2 of the patch you sent earlier [1] (cf.
Documentation/MyFirstConribution),
but otherwise, it looks good.
[1]: https://lore.kernel.org/git/20250201004556.930220-1-ayu.chandekar@xxxxxxxxx/

Meet





[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