Re: [PATCH 11/25] list-files: add --color

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

 



On Mon, Apr 6, 2015 at 9:52 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
> diff --git a/t/t7013-list-files.sh b/t/t7013-list-files.sh
> index a4916d8..cdbc34a 100755
> --- a/t/t7013-list-files.sh
> +++ b/t/t7013-list-files.sh
> @@ -110,4 +110,48 @@ test_expect_success 'list-files from subdir (2)' '
>         )
>  '
>
> +test_expect_success 'setup 2' '
> +       git init 2 &&
> +       (
> +       cd 2 &&
> +       mkdir dir &&
> +       touch file dir/file &&
> +       git init gitlink &&
> +       ( cd gitlink && test_commit foo ) &&
> +       git add file dir/file gitlink &&
> +       git commit -qm1

Minor: Why -q?

> +       )
> +'
> +
> +test_expect_success 'LS_COLORS env variable' '
> +       (
> +       cd 2 &&
> +       LS_COLORS="rs=0:fi=31:di=32" &&
> +       export LS_COLORS &&
> +       git list-files --color=always | test_decode_color | \
> +               grep -v gitlink >actual &&
> +       cat >expected <<-\EOF &&
> +       <GREEN>dir<RESET>
> +       <RED>file<RESET>
> +       EOF
> +       test_cmp expected actual
> +       )
> +'
> +
> +test_expect_success 'color.ls.*' '
> +       (
> +       cd 2 &&
> +       test_config color.ls.file red &&
> +       test_config color.ls.directory green &&
> +       test_config color.ls.submodule yellow &&
> +       git list-files --color=always | test_decode_color >actual &&
> +       cat >expected <<-\EOF &&
> +       <GREEN>dir<RESET>
> +       <RED>file<RESET>
> +       <YELLOW>gitlink<RESET>
> +       EOF
> +       test_cmp expected actual
> +       )
> +'
> +
>  test_done
> --
> 2.3.0.rc1.137.g477eb31
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]