]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t6135-pathspec-with-attrs.sh
Merge branch 'rs/parse-options-with-keep-unknown-abbrev-fix'
[thirdparty/git.git] / t / t6135-pathspec-with-attrs.sh
index 00b84ecba660a1efb25d60fa82365f617d842387..120dcd74a51434303b8bd7e71d10a9cb120bf574 100755 (executable)
@@ -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