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

Re: Expected behaviour for pathspecs matching attributes in subdirectories

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2023, 17:35 UTC
Message-ID
<xmqq7crddjtq.fsf@gitster.g>
In-Reply-To
<CAEzX-aD1wfgp8AvNNfCXVM3jAaAjK+uFTqS2XP4CJbVvFr2BtQ@mail.gmail.com>
Matthew Hughes <mhughes@uw.co.uk> writes:
> Is this the expected behaviour? I looked in t/t6135-pathspec-with-attrs.sh and
> didn't see a test case covering something similar. If this is expected, is
> there another way to achieve what I'm looking for?
I wonder if this serves a good addition to the tests?
 t/t6135-pathspec-with-attrs.sh | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git c/t/t6135-pathspec-with-attrs.sh w/t/t6135-pathspec-with-attrs.sh
index 457cc167c7..83e6bac8e5 100755
--- c/t/t6135-pathspec-with-attrs.sh
+++ w/t/t6135-pathspec-with-attrs.sh
@@ -75,6 +75,14 @@ test_expect_success 'check specific set attr' '
 	sub/fileSetLabel
 	EOF
 	git ls-files ":(attr:label)" >actual &&
+	test_cmp expect actual &&
+
+	git ls-files ":(attr:label)sub/" >actual &&
+	test_write_lines sub/fileSetLabel >expect &&
+	test_cmp expect actual &&
+
+	git ls-files ":(attr:label)sub" >actual &&
+	test_write_lines sub/fileSetLabel >expect &&
 	test_cmp expect actual
 '
 
Previous: Matthew HughesNext: Matthew Hughes
Message 2 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.