On Fri, Jul 7, 2023 at 1:26 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > +test_expect_success 'reading from .gitattributes in a subdirectory' ' > + test_when_finished "rm -f sub/.gitattributes" && > + test_write_lines "fileSetLabel label1" >sub/.gitattributes && > + > + git ls-files ":(attr:label1)" >actual && > + test_write_lines "sub/fileSetLabel" >expect && > + test_cmp expect actual && > + > + git ls-files ":(attr:label1)sub" >actual && > + test_write_lines "sub/fileSetLabel" >expect && > + test_cmp expect actual && > + > + git ls-files ":(attr:label1)sub/" >actual && > + test_write_lines "sub/fileSetLabel" >expect && > + test_cmp expect actual > +' Perhaps shave off a bit of cognitive overhead by using `echo` for these rather than `test_write_lines`. For instance: echo "fileSetLabel label1" >sub/.gitattributes && ... echo "sub/fileSetLabel" >expect && and so on.