Skip to content

Commit 4b093e7

Browse files
committed
pathspec: use GIT_ASSERT
1 parent 16b1a75 commit 4b093e7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/pathspec.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ int git_pathspec_matches_path(
289289
bool no_fnmatch = (flags & GIT_PATHSPEC_NO_GLOB) != 0;
290290
bool casefold = (flags & GIT_PATHSPEC_IGNORE_CASE) != 0;
291291

292-
assert(ps && path);
292+
GIT_ASSERT_ARG(ps);
293+
GIT_ASSERT_ARG(path);
293294

294295
return (0 != git_pathspec__match(
295296
&ps->pathspec, path, no_fnmatch, casefold, NULL, NULL));
@@ -526,7 +527,7 @@ int git_pathspec_match_workdir(
526527
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
527528
int error = 0;
528529

529-
assert(repo);
530+
GIT_ASSERT_ARG(repo);
530531

531532
iter_opts.flags = pathspec_match_iter_flags(flags);
532533

@@ -548,7 +549,7 @@ int git_pathspec_match_index(
548549
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
549550
int error = 0;
550551

551-
assert(index);
552+
GIT_ASSERT_ARG(index);
552553

553554
iter_opts.flags = pathspec_match_iter_flags(flags);
554555

@@ -570,7 +571,7 @@ int git_pathspec_match_tree(
570571
git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;
571572
int error = 0;
572573

573-
assert(tree);
574+
GIT_ASSERT_ARG(tree);
574575

575576
iter_opts.flags = pathspec_match_iter_flags(flags);
576577

@@ -598,7 +599,7 @@ int git_pathspec_match_diff(
598599
const git_diff_delta *delta, **match;
599600
git_bitvec used_patterns;
600601

601-
assert(diff);
602+
GIT_ASSERT_ARG(diff);
602603

603604
if (git_bitvec_init(&used_patterns, patterns->length) < 0)
604605
return -1;

0 commit comments

Comments
 (0)