Commit a08bd547b88fbd56efba6b9735cec612c610a52f

Edward Thomson 2020-04-05T16:24:26

fetchhead: use GIT_ASSERT

diff --git a/src/fetchhead.c b/src/fetchhead.c
index ea610f3..88c567e 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -73,7 +73,8 @@ int git_fetchhead_ref_create(
 {
 	git_fetchhead_ref *fetchhead_ref;
 
-	assert(out && oid);
+	GIT_ASSERT_ARG(out);
+	GIT_ASSERT_ARG(oid);
 
 	*out = NULL;
 
@@ -108,7 +109,8 @@ static int fetchhead_ref_write(
 	const char *type, *name;
 	int head = 0;
 
-	assert(file && fetchhead_ref);
+	GIT_ASSERT_ARG(file);
+	GIT_ASSERT_ARG(fetchhead_ref);
 
 	git_oid_fmt(oid, &fetchhead_ref->oid);
 	oid[GIT_OID_HEXSZ] = '\0';
@@ -145,7 +147,8 @@ int git_fetchhead_write(git_repository *repo, git_vector *fetchhead_refs)
 	unsigned int i;
 	git_fetchhead_ref *fetchhead_ref;
 
-	assert(repo && fetchhead_refs);
+	GIT_ASSERT_ARG(repo);
+	GIT_ASSERT_ARG(fetchhead_refs);
 
 	if (git_buf_joinpath(&path, repo->gitdir, GIT_FETCH_HEAD_FILE) < 0)
 		return -1;
@@ -279,7 +282,8 @@ int git_repository_fetchhead_foreach(git_repository *repo,
 	size_t line_num = 0;
 	int error = 0;
 
-	assert(repo && cb);
+	GIT_ASSERT_ARG(repo);
+	GIT_ASSERT_ARG(cb);
 
 	if (git_buf_joinpath(&path, repo->gitdir, GIT_FETCH_HEAD_FILE) < 0)
 		return -1;