File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,30 @@ void test_filter_systemattrs__reads_system_attributes(void)
5252 git_buf_dispose (& buf );
5353 git_blob_free (blob );
5454}
55+
56+ void test_filter_systemattrs__disables_system_attributes (void )
57+ {
58+ git_blob * blob ;
59+ git_buf buf = { 0 };
60+ git_blob_filter_options opts = GIT_BLOB_FILTER_OPTIONS_INIT ;
61+
62+ opts .flags |= GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES ;
63+
64+ cl_git_pass (git_revparse_single (
65+ (git_object * * )& blob , g_repo , "799770d" )); /* all-lf */
66+
67+ cl_assert_equal_s (ALL_LF_TEXT_RAW , git_blob_rawcontent (blob ));
68+
69+ cl_git_pass (git_blob_filter (& buf , blob , "file.bin" , & opts ));
70+ cl_assert_equal_s (ALL_LF_TEXT_RAW , buf .ptr );
71+
72+ /* No attributes mean these are all treated literally */
73+ cl_git_pass (git_blob_filter (& buf , blob , "file.crlf" , & opts ));
74+ cl_assert_equal_s (ALL_LF_TEXT_RAW , buf .ptr );
75+
76+ cl_git_pass (git_blob_filter (& buf , blob , "file.lf" , & opts ));
77+ cl_assert_equal_s (ALL_LF_TEXT_RAW , buf .ptr );
78+
79+ git_buf_dispose (& buf );
80+ git_blob_free (blob );
81+ }
You can’t perform that action at this time.
0 commit comments