pathspec: 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
diff --git a/src/pathspec.c b/src/pathspec.c
index 83f776c..8b17a6e 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -289,7 +289,8 @@ int git_pathspec_matches_path(
bool no_fnmatch = (flags & GIT_PATHSPEC_NO_GLOB) != 0;
bool casefold = (flags & GIT_PATHSPEC_IGNORE_CASE) != 0;
- assert(ps && path);
+ GIT_ASSERT_ARG(ps);
+ GIT_ASSERT_ARG(path);
return (0 != git_pathspec__match(
&ps->pathspec, path, no_fnmatch, casefold, NULL, NULL));
@@ -526,7 +527,7 @@ int git_pathspec_match_workdir(
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
int error = 0;
- assert(repo);
+ GIT_ASSERT_ARG(repo);
iter_opts.flags = pathspec_match_iter_flags(flags);
@@ -548,7 +549,7 @@ int git_pathspec_match_index(
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
int error = 0;
- assert(index);
+ GIT_ASSERT_ARG(index);
iter_opts.flags = pathspec_match_iter_flags(flags);
@@ -570,7 +571,7 @@ int git_pathspec_match_tree(
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
int error = 0;
- assert(tree);
+ GIT_ASSERT_ARG(tree);
iter_opts.flags = pathspec_match_iter_flags(flags);
@@ -598,7 +599,7 @@ int git_pathspec_match_diff(
const git_diff_delta *delta, **match;
git_bitvec used_patterns;
- assert(diff);
+ GIT_ASSERT_ARG(diff);
if (git_bitvec_init(&used_patterns, patterns->length) < 0)
return -1;