Skip to content

Commit 7e360bc

Browse files
committed
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 <[email protected]>
1 parent fb7d80e commit 7e360bc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

t/t6135-pathspec-with-attrs.sh

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,17 @@ test_expect_success 'check specific set attr' '
7878
test_cmp expect actual
7979
'
8080

81-
test_expect_success 'check specific set attr (2)' '
81+
test_expect_success 'check set attr with pathspec pattern' '
82+
echo sub/fileSetLabel >expect &&
83+
84+
git ls-files ":(attr:label)sub" >actual &&
85+
test_cmp expect actual &&
86+
87+
git ls-files ":(attr:label)sub/" >actual &&
88+
test_cmp expect actual
89+
'
90+
91+
test_expect_success 'check specific set attr in tree-ish' '
8292
cat <<-\EOF >expect &&
8393
HEAD:fileSetLabel
8494
HEAD:sub/fileSetLabel
@@ -87,6 +97,16 @@ test_expect_success 'check specific set attr (2)' '
8797
test_cmp expect actual
8898
'
8999

100+
test_expect_success 'check specific set attr with pathspec pattern in tree-ish' '
101+
echo HEAD:sub/fileSetLabel >expect &&
102+
103+
git grep -l content HEAD ":(attr:label)sub" >actual &&
104+
test_cmp expect actual &&
105+
106+
git grep -l content HEAD ":(attr:label)sub/" >actual &&
107+
test_cmp expect actual
108+
'
109+
90110
test_expect_success 'check specific unset attr' '
91111
cat <<-\EOF >expect &&
92112
fileUnsetLabel

0 commit comments

Comments
 (0)