attr_file: 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
diff --git a/src/attr_file.c b/src/attr_file.c
index 3f69b5f..0781c1d 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -351,7 +351,9 @@ uint32_t git_attr_file__name_hash(const char *name)
{
uint32_t h = 5381;
int c;
- assert(name);
+
+ GIT_ASSERT_ARG(name);
+
while ((c = (int)*name++) != 0)
h = ((h << 5) + h) + c;
return h;
@@ -660,7 +662,8 @@ int git_attr_fnmatch__parse(
int slash_count, allow_space;
bool escaped;
- assert(spec && base && *base);
+ GIT_ASSERT_ARG(spec);
+ GIT_ASSERT_ARG(base && *base);
if (parse_optimized_patterns(spec, pool, *base))
return 0;
@@ -828,7 +831,7 @@ int git_attr_assignment__parse(
const char *scan = *base;
git_attr_assignment *assign = NULL;
- assert(assigns && !assigns->length);
+ GIT_ASSERT_ARG(assigns && !assigns->length);
git_vector_set_cmp(assigns, sort_by_hash_and_name);
@@ -954,7 +957,7 @@ void git_attr_rule__free(git_attr_rule *rule)
int git_attr_session__init(git_attr_session *session, git_repository *repo)
{
- assert(repo);
+ GIT_ASSERT_ARG(repo);
memset(session, 0, sizeof(*session));
session->key = git_atomic_inc(&repo->attr_session_key);