Commit 6718ad9fae65db3988b37e4893946c565f1806ca

Edward Thomson 2020-04-05T17:20:46

notes: use GIT_ASSERT

diff --git a/src/notes.c b/src/notes.c
index a3c4b7c..b9e1985 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -627,7 +627,8 @@ int git_note_default_ref(git_buf *out, git_repository *repo)
 	char *default_ref;
 	int error;
 
-	assert(out && repo);
+	GIT_ASSERT_ARG(out);
+	GIT_ASSERT_ARG(repo);
 
 	if ((error = git_buf_sanitize(out)) < 0 ||
 	    (error = note_get_default_ref(&default_ref, repo)) < 0)
@@ -639,25 +640,25 @@ int git_note_default_ref(git_buf *out, git_repository *repo)
 
 const git_signature *git_note_committer(const git_note *note)
 {
-	assert(note);
+	GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
 	return note->committer;
 }
 
 const git_signature *git_note_author(const git_note *note)
 {
-	assert(note);
+	GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
 	return note->author;
 }
 
-const char * git_note_message(const git_note *note)
+const char *git_note_message(const git_note *note)
 {
-	assert(note);
+	GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
 	return note->message;
 }
 
-const git_oid * git_note_id(const git_note *note)
+const git_oid *git_note_id(const git_note *note)
 {
-	assert(note);
+	GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
 	return &note->id;
 }