From: Eric Sunshine Date: Mon, 06 Apr 2015 21:33:36 GMT Subject: Re: [PATCH 11/25] list-files: add --color Message-ID: In-Reply-To: <1428328354-14897-12-git-send-email-pclouds@gmail.com> On Mon, Apr 6, 2015 at 9:52 AM, Nguyễn Thái Ngọc Duy wrote: > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > 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 && > + dir > + file > + 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 && > + dir > + file > + gitlink > + EOF > + test_cmp expected actual > + ) > +' > + > test_done > -- > 2.3.0.rc1.137.g477eb31