Re: Expected behaviour for pathspecs matching attributes in subdirectories
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 7, 2023, 19:28 UTC
- Message-ID
- <CAPig+cSo8+bh7vHBchwLfpdxehHmRFnbsOKOCpKoYGd=bzO_ig@mail.gmail.com>
- In-Reply-To
- <xmqq1qhjbpoz.fsf@gitster.g>
On Fri, Jul 7, 2023 at 1:26 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> +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.