Re: [PATCHv6 03/31] directory rename detection: testcases to avoid taking detection too far

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

 



On Fri, Jan 5, 2018 at 9:26 PM, Elijah Newren <newren@xxxxxxxxx> wrote:
> Signed-off-by: Elijah Newren <newren@xxxxxxxxx>
> ---
>  t/t6043-merge-rename-directories.sh | 153 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 153 insertions(+)
>
> diff --git a/t/t6043-merge-rename-directories.sh b/t/t6043-merge-rename-directories.sh
> index f36493289..239819f2d 100755
> --- a/t/t6043-merge-rename-directories.sh
> +++ b/t/t6043-merge-rename-directories.sh

> +test_expect_success '3b-check: Avoid implicit rename if involved as source on current side' '
> +       (
> +               cd 3b &&
> +
> +               git checkout A^0 &&
> +
> +               test_must_fail git merge -s recursive B^0 >out &&
> +               test_i18ngrep CONFLICT.*rename/rename.*z/d.*x/d.*w/d out &&
> +               test_i18ngrep ! CONFLICT.*rename/rename.*y/d &&

The filename argument is missing in the above line.

Why does the test still succeed, then?  Because 'test_i18ngrep' is
expected not to find the given pattern, and of course it won't find the
pattern if its input is empty as it comes from /dev/null instead of the
appropriate file.


> +
> +               git ls-files -s >out &&
> +               test_line_count = 5 out &&
> +               git ls-files -u >out &&
> +               test_line_count = 3 out &&
> +               git ls-files -o >out &&
> +               test_line_count = 1 out &&
> +
> +               git rev-parse >actual \
> +                       :0:y/b :0:y/c :1:z/d :2:x/d :3:w/d &&
> +               git rev-parse >expect \
> +                       O:z/b O:z/c O:z/d O:z/d O:z/d &&
> +               test_cmp expect actual &&
> +
> +               test_path_is_missing z/d &&
> +               git hash-object >actual \
> +                       x/d w/d &&
> +               git rev-parse >expect \
> +                       O:z/d O:z/d &&
> +               test_cmp expect actual
> +       )
> +'
> +
> +###########################################################################
> +# Rules suggested by section 3:
> +#
> +#   Avoid directory-rename-detection for a path, if that path is the source
> +#   of a rename on either side of a merge.
> +###########################################################################
> +
>  test_done
> --
> 2.14.2
>



[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