Commit a008ceeaf774484cc0b5d10b7f2fcd1592c354bb

Edward Thomson 2019-07-21T11:01:36

blob: convert users of git_blob_filtered_content Move users of `git_blob_filtered_content` to `git_blob_filter`.

diff --git a/tests/filter/blob.c b/tests/filter/blob.c
index ff8ac1e..1cc33d4 100644
--- a/tests/filter/blob.c
+++ b/tests/filter/blob.c
@@ -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_filtered_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_filtered_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_filtered_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_filtered_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_filtered_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_filtered_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_filtered_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_filtered_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_filtered_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$\nGoes there\n", git_blob_rawcontent(blob));
 
-	cl_git_pass(git_blob_filtered_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$\nGoes there\n", buf.ptr);
 
-	cl_git_pass(git_blob_filtered_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\nGoes there\r\n", buf.ptr);
 
-	cl_git_pass(git_blob_filtered_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 $\nGoes there\n", buf.ptr);
 
diff --git a/tests/filter/custom.c b/tests/filter/custom.c
index b9e4f73..fe2025f 100644
--- a/tests/filter/custom.c
+++ b/tests/filter/custom.c
@@ -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$\ntset a si sihT", git_blob_rawcontent(blob));
-	cl_git_pass(git_blob_filtered_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$\ntset rehtonA", git_blob_rawcontent(blob));
-	cl_git_pass(git_blob_filtered_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(