Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-08 01:04:56 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-08 01:23:42 +0300
commit7e360bc6267e4741b75d30ec19a7461ed869a244 (patch)
treebd7c97451af7be9cfc0f11155672fec60a98f4d1 /t/t6135-pathspec-with-attrs.sh
parentfb7d80edcae482f4fa5d4be0227dc3054734e5f3 (diff)
t6135: attr magic with path pattern
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>
Diffstat (limited to 't/t6135-pathspec-with-attrs.sh')
-rwxr-xr-xt/t6135-pathspec-with-attrs.sh22
1 files changed, 21 insertions, 1 deletions
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