merge_driver: 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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
diff --git a/src/merge_driver.c b/src/merge_driver.c
index b1f5748..17c386a 100644
--- a/src/merge_driver.c
+++ b/src/merge_driver.c
@@ -32,33 +32,38 @@ static struct merge_driver_registry merge_driver_registry;
static void git_merge_driver_global_shutdown(void);
-git_repository* git_merge_driver_source_repo(const git_merge_driver_source *src)
+git_repository *git_merge_driver_source_repo(
+ const git_merge_driver_source *src)
{
- assert(src);
+ GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
return src->repo;
}
-const git_index_entry* git_merge_driver_source_ancestor(const git_merge_driver_source *src)
+const git_index_entry *git_merge_driver_source_ancestor(
+ const git_merge_driver_source *src)
{
- assert(src);
+ GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
return src->ancestor;
}
-const git_index_entry* git_merge_driver_source_ours(const git_merge_driver_source *src)
+const git_index_entry *git_merge_driver_source_ours(
+ const git_merge_driver_source *src)
{
- assert(src);
+ GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
return src->ours;
}
-const git_index_entry* git_merge_driver_source_theirs(const git_merge_driver_source *src)
+const git_index_entry *git_merge_driver_source_theirs(
+ const git_merge_driver_source *src)
{
- assert(src);
+ GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
return src->theirs;
}
-const git_merge_file_options* git_merge_driver_source_file_options(const git_merge_driver_source *src)
+const git_merge_file_options *git_merge_driver_source_file_options(
+ const git_merge_driver_source *src)
{
- assert(src);
+ GIT_ASSERT_ARG_WITH_RETVAL(src, NULL);
return src->file_opts;
}
@@ -262,7 +267,8 @@ int git_merge_driver_register(const char *name, git_merge_driver *driver)
{
int error;
- assert(name && driver);
+ GIT_ASSERT_ARG(name);
+ GIT_ASSERT_ARG(driver);
if (git_rwlock_wrlock(&merge_driver_registry.lock) < 0) {
git_error_set(GIT_ERROR_OS, "failed to lock merge driver registry");