git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Expected behaviour for pathspecs matching attributes in subdirectories

From
MHMatthew Hughes <mhughes@uw.co.uk>
Date
Jul 6, 2023, 21:00 UTC
Message-ID
<CAEzX-aBUyKivBYTFaLh0_irEH5ToVTVBUsSSU03-3ZMdPbjOow@mail.gmail.com>
In-Reply-To
<CAEzX-aC=UDkf6nevLbN0bNyGXujZVDuqtCp3YcYhAPD6zvYZiQ@mail.gmail.com>

Apologies, re-sending the patch as an attachment instead, since Gmail decided to strip the tab characters

diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
index 457cc167c7..7a7502a6eb 100755
--- a/t/t6135-pathspec-with-attrs.sh
+++ b/t/t6135-pathspec-with-attrs.sh
@@ -87,6 +87,23 @@ test_expect_success 'check specific set attr (2)' '
 	test_cmp expect actual
 '
 
+test_expect_success 'check specific set attr nested .gitattributes' '
+	cat <<-\EOF >sub/.gitattributes &&
+	fileSetLabel otherLabel
+	EOF
+	test_write_lines sub/fileSetLabel >expect &&
+	git ls-files ":(attr:otherLabel)" >actual &&
+	test_cmp expect actual &&
+
+	git ls-files ":(attr:otherLabel)sub" >actual &&
+	test_cmp expect actual &&
+
+	git ls-files ":(attr:otherLabel)sub/" >actual &&
+	test_must_be_empty actual &&
+
+	rm sub/.gitattributes
+'
+
 test_expect_success 'check specific unset attr' '
 	cat <<-\EOF >expect &&
 	fileUnsetLabel
Previous: Matthew HughesNext: Junio C Hamano
Message 4 of 9 in “Expected behaviour for pathspecs matching attributes in subdirectories”
  1. Matthew HughesJul 6, 2023
  2. Junio C HamanoJul 6, 2023
  3. Matthew HughesJul 6, 2023
  4. Matthew HughesJul 6, 2023
  5. Junio C HamanoJul 6, 2023
  6. Matthew HughesJul 7, 2023
  7. Junio C HamanoJul 7, 2023
  8. Eric SunshineJul 7, 2023
  9. Matthew HughesJul 8, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.