Commit 00e57f646d9afb3c434b3ee1d4b9c5462e7ab617

Edward Thomson 2020-04-05T19:15:11

reader: use GIT_ASSERT

diff --git a/src/reader.c b/src/reader.c
index 90f700a..9672473 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -61,7 +61,8 @@ int git_reader_for_tree(git_reader **out, git_tree *tree)
 {
 	tree_reader *reader;
 
-	assert(out && tree);
+	GIT_ASSERT_ARG(out);
+	GIT_ASSERT_ARG(tree);
 
 	reader = git__calloc(1, sizeof(tree_reader));
 	GIT_ERROR_CHECK_ALLOC(reader);
@@ -158,7 +159,8 @@ int git_reader_for_workdir(
 	workdir_reader *reader;
 	int error;
 
-	assert(out && repo);
+	GIT_ASSERT_ARG(out);
+	GIT_ASSERT_ARG(repo);
 
 	reader = git__calloc(1, sizeof(workdir_reader));
 	GIT_ERROR_CHECK_ALLOC(reader);
@@ -223,7 +225,8 @@ int git_reader_for_index(
 	index_reader *reader;
 	int error;
 
-	assert(out && repo);
+	GIT_ASSERT_ARG(out);
+	GIT_ASSERT_ARG(repo);
 
 	reader = git__calloc(1, sizeof(index_reader));
 	GIT_ERROR_CHECK_ALLOC(reader);
@@ -251,7 +254,9 @@ int git_reader_read(
 	git_reader *reader,
 	const char *filename)
 {
-	assert(out && reader && filename);
+	GIT_ASSERT_ARG(out);
+	GIT_ASSERT_ARG(reader);
+	GIT_ASSERT_ARG(filename);
 
 	return reader->read(out, out_id, out_filemode, reader, filename);
 }