From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 1/2] t6135: attr magic with path pattern
Date: Fri, 7 Jul 2023 15:04:56 -0700 [thread overview]
Message-ID: <20230707220457.3655121-2-gitster@pobox.com> (raw)
In-Reply-To: <20230707220457.3655121-1-gitster@pobox.com>
The test coverage on attribute magic combined with path pattern
was a bit thin. Let's add a few and make sure "(attr:X)sub" and
"(attr:X)sub/" behave the same.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
t/t6135-pathspec-with-attrs.sh | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
index 457cc167c7..f63774094f 100755
--- a/t/t6135-pathspec-with-attrs.sh
+++ b/t/t6135-pathspec-with-attrs.sh
@@ -78,7 +78,17 @@ test_expect_success 'check specific set attr' '
test_cmp expect actual
'
-test_expect_success 'check specific set attr (2)' '
+test_expect_success 'check set attr with pathspec pattern' '
+ echo sub/fileSetLabel >expect &&
+
+ git ls-files ":(attr:label)sub" >actual &&
+ test_cmp expect actual &&
+
+ git ls-files ":(attr:label)sub/" >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'check specific set attr in tree-ish' '
cat <<-\EOF >expect &&
HEAD:fileSetLabel
HEAD:sub/fileSetLabel
@@ -87,6 +97,16 @@ test_expect_success 'check specific set attr (2)' '
test_cmp expect actual
'
+test_expect_success 'check specific set attr with pathspec pattern in tree-ish' '
+ echo HEAD:sub/fileSetLabel >expect &&
+
+ git grep -l content HEAD ":(attr:label)sub" >actual &&
+ test_cmp expect actual &&
+
+ git grep -l content HEAD ":(attr:label)sub/" >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'check specific unset attr' '
cat <<-\EOF >expect &&
fileUnsetLabel
--
2.41.0-318-g061c58647e
next prev parent reply other threads:[~2023-07-07 22:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 22:04 [PATCH 0/2] Fix attr magic combined with pathspec prefix Junio C Hamano
2023-07-07 22:04 ` Junio C Hamano [this message]
2023-07-07 22:04 ` [PATCH 2/2] dir: do not feed path suffix to pathspec match Junio C Hamano
2023-07-07 23:45 ` [PATCH 2/2alt] " Junio C Hamano
2023-07-08 7:16 ` René Scharfe
2023-07-08 21:35 ` [PATCH 2alt/2] dir: match "attr" pathspec magic with correct paths Junio C Hamano
2023-07-09 5:35 ` René Scharfe
2023-07-09 9:28 ` Junio C Hamano
2023-07-08 7:16 ` [PATCH 2/2] dir: do not feed path suffix to pathspec match René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230707220457.3655121-2-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).