Commit 61f33f3e by Edward Thomson

merge_driver: use GIT_ASSERT

parent c59fbafd
...@@ -32,33 +32,38 @@ static struct merge_driver_registry merge_driver_registry; ...@@ -32,33 +32,38 @@ static struct merge_driver_registry merge_driver_registry;
static void git_merge_driver_global_shutdown(void); 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; 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; 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; 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; 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; return src->file_opts;
} }
...@@ -262,7 +267,8 @@ int git_merge_driver_register(const char *name, git_merge_driver *driver) ...@@ -262,7 +267,8 @@ int git_merge_driver_register(const char *name, git_merge_driver *driver)
{ {
int error; int error;
assert(name && driver); GIT_ASSERT_ARG(name);
GIT_ASSERT_ARG(driver);
if (git_rwlock_wrlock(&merge_driver_registry.lock) < 0) { if (git_rwlock_wrlock(&merge_driver_registry.lock) < 0) {
git_error_set(GIT_ERROR_OS, "failed to lock merge driver registry"); git_error_set(GIT_ERROR_OS, "failed to lock merge driver registry");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment