File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,34 @@ void test_filter_blob__all_crlf(void)
4848 git_blob_free (blob );
4949}
5050
51+ void test_filter_blob__from_lf (void )
52+ {
53+ git_blob * blob ;
54+ git_buf buf = { 0 };
55+
56+ cl_git_pass (git_revparse_single (
57+ (git_object * * )& blob , g_repo , "799770d" )); /* all-lf */
58+
59+ cl_assert_equal_s (ALL_LF_TEXT_RAW , git_blob_rawcontent (blob ));
60+
61+ cl_git_pass (git_blob_filtered_content (& buf , blob , "file.bin" , 1 ));
62+
63+ cl_assert_equal_s (ALL_LF_TEXT_RAW , buf .ptr );
64+
65+ cl_git_pass (git_blob_filtered_content (& buf , blob , "file.crlf" , 1 ));
66+
67+ /* in this case, raw content has crlf in it already */
68+ cl_assert_equal_s (ALL_LF_TEXT_AS_CRLF , buf .ptr );
69+
70+ cl_git_pass (git_blob_filtered_content (& buf , blob , "file.lf" , 1 ));
71+
72+ /* we never convert CRLF -> LF on platforms that have LF */
73+ cl_assert_equal_s (ALL_LF_TEXT_AS_LF , buf .ptr );
74+
75+ git_buf_dispose (& buf );
76+ git_blob_free (blob );
77+ }
78+
5179void test_filter_blob__sanitizes (void )
5280{
5381 git_blob * blob ;
You can’t perform that action at this time.
0 commit comments