Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a008ceea
Commit
a008ceea
authored
Jul 21, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blob: convert users of git_blob_filtered_content
Move users of `git_blob_filtered_content` to `git_blob_filter`.
parent
a32ab076
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
tests/filter/blob.c
+12
-12
tests/filter/custom.c
+2
-2
No files found.
tests/filter/blob.c
View file @
a008ceea
...
...
@@ -30,16 +30,16 @@ void test_filter_blob__all_crlf(void)
cl_assert_equal_s
(
ALL_CRLF_TEXT_RAW
,
git_blob_rawcontent
(
blob
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.bin"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.bin"
,
NULL
));
cl_assert_equal_s
(
ALL_CRLF_TEXT_RAW
,
buf
.
ptr
);
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.crlf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.crlf"
,
NULL
));
/* in this case, raw content has crlf in it already */
cl_assert_equal_s
(
ALL_CRLF_TEXT_AS_CRLF
,
buf
.
ptr
);
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.lf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.lf"
,
NULL
));
/* we never convert CRLF -> LF on platforms that have LF */
cl_assert_equal_s
(
ALL_CRLF_TEXT_AS_CRLF
,
buf
.
ptr
);
...
...
@@ -58,16 +58,16 @@ void test_filter_blob__from_lf(void)
cl_assert_equal_s
(
ALL_LF_TEXT_RAW
,
git_blob_rawcontent
(
blob
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.bin"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.bin"
,
NULL
));
cl_assert_equal_s
(
ALL_LF_TEXT_RAW
,
buf
.
ptr
);
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.crlf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.crlf"
,
NULL
));
/* in this case, raw content has crlf in it already */
cl_assert_equal_s
(
ALL_LF_TEXT_AS_CRLF
,
buf
.
ptr
);
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.lf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.lf"
,
NULL
));
/* we never convert CRLF -> LF on platforms that have LF */
cl_assert_equal_s
(
ALL_LF_TEXT_AS_LF
,
buf
.
ptr
);
...
...
@@ -88,19 +88,19 @@ void test_filter_blob__sanitizes(void)
cl_assert_equal_s
(
""
,
git_blob_rawcontent
(
blob
));
memset
(
&
buf
,
0
,
sizeof
(
git_buf
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.bin"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.bin"
,
NULL
));
cl_assert_equal_sz
(
0
,
buf
.
size
);
cl_assert_equal_s
(
""
,
buf
.
ptr
);
git_buf_dispose
(
&
buf
);
memset
(
&
buf
,
0
,
sizeof
(
git_buf
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.crlf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.crlf"
,
NULL
));
cl_assert_equal_sz
(
0
,
buf
.
size
);
cl_assert_equal_s
(
""
,
buf
.
ptr
);
git_buf_dispose
(
&
buf
);
memset
(
&
buf
,
0
,
sizeof
(
git_buf
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"file.lf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"file.lf"
,
NULL
));
cl_assert_equal_sz
(
0
,
buf
.
size
);
cl_assert_equal_s
(
""
,
buf
.
ptr
);
git_buf_dispose
(
&
buf
);
...
...
@@ -127,15 +127,15 @@ void test_filter_blob__ident(void)
cl_assert_equal_s
(
"Some text
\n
$Id$
\n
Goes there
\n
"
,
git_blob_rawcontent
(
blob
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"filter.bin"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"filter.bin"
,
NULL
));
cl_assert_equal_s
(
"Some text
\n
$Id$
\n
Goes there
\n
"
,
buf
.
ptr
);
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"filter.identcrlf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"filter.identcrlf"
,
NULL
));
cl_assert_equal_s
(
"Some text
\r\n
$Id: 3164f585d548ac68027d22b104f2d8100b2b6845 $
\r\n
Goes there
\r\n
"
,
buf
.
ptr
);
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"filter.identlf"
,
1
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"filter.identlf"
,
NULL
));
cl_assert_equal_s
(
"Some text
\n
$Id: 3164f585d548ac68027d22b104f2d8100b2b6845 $
\n
Goes there
\n
"
,
buf
.
ptr
);
...
...
tests/filter/custom.c
View file @
a008ceea
...
...
@@ -208,7 +208,7 @@ void test_filter_custom__order_dependency(void)
&
git_index_get_bypath
(
index
,
"hero.1.rev-ident"
,
0
)
->
id
));
cl_assert_equal_s
(
"
\n
!nuf evaH
\n
$dI$
\n
tset a si sihT"
,
git_blob_rawcontent
(
blob
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"hero.1.rev-ident"
,
0
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"hero.1.rev-ident"
,
NULL
));
/* no expansion because id was reversed at checkin and now at ident
* time, reverse is not applied yet */
cl_assert_equal_s
(
...
...
@@ -219,7 +219,7 @@ void test_filter_custom__order_dependency(void)
&
git_index_get_bypath
(
index
,
"hero.2.rev-ident"
,
0
)
->
id
));
cl_assert_equal_s
(
"
\n
!yzarC
\n
$Id$
\n
tset rehtonA"
,
git_blob_rawcontent
(
blob
));
cl_git_pass
(
git_blob_filter
ed_content
(
&
buf
,
blob
,
"hero.2.rev-ident"
,
0
));
cl_git_pass
(
git_blob_filter
(
&
buf
,
blob
,
"hero.2.rev-ident"
,
NULL
));
/* expansion because reverse was applied at checkin and at ident time,
* reverse is not applied yet */
cl_assert_equal_s
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment