fetchhead: use GIT_ASSERT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
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;