summaryrefslogtreecommitdiff
path: root/src/status.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-11-27 11:36:58 +0000
committerGitHub <noreply@github.com>2020-11-27 11:36:58 +0000
commitfa618a595bff675fa1d001dc9d57f8fd6c1b052e (patch)
tree3501f3fe98ac5ec0d909f79c0f7353f54a77b1dc /src/status.c
parentb8cdc9c9c59c61fc699550af5245c57744c1bcbd (diff)
parentc6ebdb296bc44b50fa76e492f57f086bf6c9ec08 (diff)
downloadlibgit2-fa618a595bff675fa1d001dc9d57f8fd6c1b052e.tar.gz
Merge pull request #5327 from libgit2/ethomson/assert
Introduce GIT_ASSERT macros
Diffstat (limited to 'src/status.c')
-rw-r--r--src/status.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/status.c b/src/status.c
index eca1f4912..c98564643 100644
--- a/src/status.c
+++ b/src/status.c
@@ -391,14 +391,14 @@ done:
size_t git_status_list_entrycount(git_status_list *status)
{
- assert(status);
+ GIT_ASSERT_ARG_WITH_RETVAL(status, 0);
return status->paired.length;
}
const git_status_entry *git_status_byindex(git_status_list *status, size_t i)
{
- assert(status);
+ GIT_ASSERT_ARG_WITH_RETVAL(status, NULL);
return git_vector_get(&status->paired, i);
}
@@ -492,7 +492,9 @@ int git_status_file(
struct status_file_info sfi = {0};
git_index *index;
- assert(status_flags && repo && path);
+ GIT_ASSERT_ARG(status_flags);
+ GIT_ASSERT_ARG(repo);
+ GIT_ASSERT_ARG(path);
if ((error = git_repository_index__weakptr(&index, repo)) < 0)
return error;
@@ -558,7 +560,8 @@ int git_status_init_options(git_status_options *opts, unsigned int version)
int git_status_list_get_perfdata(
git_diff_perfdata *out, const git_status_list *status)
{
- assert(out);
+ GIT_ASSERT_ARG(out);
+
GIT_ERROR_CHECK_VERSION(out, GIT_DIFF_PERFDATA_VERSION, "git_diff_perfdata");
out->stat_calls = 0;