aboutsummaryrefslogtreecommitdiffstats
path: root/t/t6135-pathspec-with-attrs.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-01-12 16:09:55 -0800
committerJunio C Hamano <gitster@pobox.com>2024-01-12 16:09:55 -0800
commit3e8558438da8cecbc19d0dbcb786dbf9ca9462e1 (patch)
tree5bbd1623c433c47f29326be6e721332da2e9886f /t/t6135-pathspec-with-attrs.sh
parentMerge branch 'js/contributor-docs-updates' (diff)
parentattr: add builtin objectmode values support (diff)
downloadgit-3e8558438da8cecbc19d0dbcb786dbf9ca9462e1.tar.gz
git-3e8558438da8cecbc19d0dbcb786dbf9ca9462e1.zip
Merge branch 'jw/builtin-objectmode-attr'
The builtin_objectmode attribute is populated for each path without adding anything in .gitattributes files, which would be useful in magic pathspec, e.g., ":(attr:builtin_objectmode=100755)" to limit to executables. * jw/builtin-objectmode-attr: attr: add builtin objectmode values support
Diffstat (limited to 't/t6135-pathspec-with-attrs.sh')
-rwxr-xr-xt/t6135-pathspec-with-attrs.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
index 00b84ecba6..120dcd74a5 100755
--- a/t/t6135-pathspec-with-attrs.sh
+++ b/t/t6135-pathspec-with-attrs.sh
@@ -393,4 +393,31 @@ test_expect_success 'reading from .gitattributes in a subdirectory (3)' '
test_cmp expect actual
'
+test_expect_success POSIXPERM 'pathspec with builtin_objectmode attr can be used' '
+ >mode_exec_file_1 &&
+
+ git status -s ":(attr:builtin_objectmode=100644)mode_exec_*" >actual &&
+ echo ?? mode_exec_file_1 >expect &&
+ test_cmp expect actual &&
+
+ git add mode_exec_file_1 &&
+ chmod +x mode_exec_file_1 &&
+ git status -s ":(attr:builtin_objectmode=100755)mode_exec_*" >actual &&
+ echo AM mode_exec_file_1 >expect &&
+ test_cmp expect actual
+'
+
+test_expect_success POSIXPERM 'builtin_objectmode attr can be excluded' '
+ >mode_1_regular &&
+ >mode_1_exec &&
+ chmod +x mode_1_exec &&
+ git status -s ":(exclude,attr:builtin_objectmode=100644)" "mode_1_*" >actual &&
+ echo ?? mode_1_exec >expect &&
+ test_cmp expect actual &&
+
+ git status -s ":(exclude,attr:builtin_objectmode=100755)" "mode_1_*" >actual &&
+ echo ?? mode_1_regular >expect &&
+ test_cmp expect actual
+'
+
test_done