@@ -50,7 +50,9 @@ int git_reflog_read(git_reflog **reflog, git_repository *repo, const char *name
5050 git_refdb * refdb ;
5151 int error ;
5252
53- assert (reflog && repo && name );
53+ GIT_ASSERT_ARG (reflog );
54+ GIT_ASSERT_ARG (repo );
55+ GIT_ASSERT_ARG (name );
5456
5557 if ((error = git_repository_refdb__weakptr (& refdb , repo )) < 0 )
5658 return error ;
@@ -62,7 +64,8 @@ int git_reflog_write(git_reflog *reflog)
6264{
6365 git_refdb * db ;
6466
65- assert (reflog && reflog -> db );
67+ GIT_ASSERT_ARG (reflog );
68+ GIT_ASSERT_ARG (reflog -> db );
6669
6770 db = reflog -> db ;
6871 return db -> backend -> reflog_write (db -> backend , reflog );
@@ -73,7 +76,9 @@ int git_reflog_append(git_reflog *reflog, const git_oid *new_oid, const git_sign
7376 const git_reflog_entry * previous ;
7477 git_reflog_entry * entry ;
7578
76- assert (reflog && new_oid && committer );
79+ GIT_ASSERT_ARG (reflog );
80+ GIT_ASSERT_ARG (new_oid );
81+ GIT_ASSERT_ARG (committer );
7782
7883 entry = git__calloc (1 , sizeof (git_reflog_entry ));
7984 GIT_ERROR_CHECK_ALLOC (entry );
@@ -139,13 +144,13 @@ int git_reflog_delete(git_repository *repo, const char *name)
139144
140145size_t git_reflog_entrycount (git_reflog * reflog )
141146{
142- assert (reflog );
147+ GIT_ASSERT_ARG_WITH_RETVAL (reflog , 0 );
143148 return reflog -> entries .length ;
144149}
145150
146- const git_reflog_entry * git_reflog_entry_byindex (const git_reflog * reflog , size_t idx )
151+ const git_reflog_entry * git_reflog_entry_byindex (const git_reflog * reflog , size_t idx )
147152{
148- assert (reflog );
153+ GIT_ASSERT_ARG_WITH_RETVAL (reflog , NULL );
149154
150155 if (idx >= reflog -> entries .length )
151156 return NULL ;
@@ -154,27 +159,27 @@ const git_reflog_entry * git_reflog_entry_byindex(const git_reflog *reflog, size
154159 & reflog -> entries , reflog_inverse_index (idx , reflog -> entries .length ));
155160}
156161
157- const git_oid * git_reflog_entry_id_old (const git_reflog_entry * entry )
162+ const git_oid * git_reflog_entry_id_old (const git_reflog_entry * entry )
158163{
159- assert (entry );
164+ GIT_ASSERT_ARG_WITH_RETVAL (entry , NULL );
160165 return & entry -> oid_old ;
161166}
162167
163- const git_oid * git_reflog_entry_id_new (const git_reflog_entry * entry )
168+ const git_oid * git_reflog_entry_id_new (const git_reflog_entry * entry )
164169{
165- assert (entry );
170+ GIT_ASSERT_ARG_WITH_RETVAL (entry , NULL );
166171 return & entry -> oid_cur ;
167172}
168173
169- const git_signature * git_reflog_entry_committer (const git_reflog_entry * entry )
174+ const git_signature * git_reflog_entry_committer (const git_reflog_entry * entry )
170175{
171- assert (entry );
176+ GIT_ASSERT_ARG_WITH_RETVAL (entry , NULL );
172177 return entry -> committer ;
173178}
174179
175- const char * git_reflog_entry_message (const git_reflog_entry * entry )
180+ const char * git_reflog_entry_message (const git_reflog_entry * entry )
176181{
177- assert (entry );
182+ GIT_ASSERT_ARG_WITH_RETVAL (entry , NULL );
178183 return entry -> msg ;
179184}
180185
0 commit comments