The functions loose_object_mode and loose_object_dir_mode call stat
inside an assert statement which isn't evaluated when compiling in
Release mode (NDEBUG) and leads to failing tests. Replace it.
Signed-off-by: schu <schu-github@schulog.org>
struct stat st;
locate_loose_object(repository_folder, object, &object_path, NULL);
- assert(p_stat(object_path, &st) == 0);
+ if (p_stat(object_path, &st) < 0)
+ return 0;
free(object_path);
return st.st_mode;
}
}
- assert(p_stat(object_path, &st) == 0);
+ if (p_stat(object_path, &st) < 0)
+ return 0;
free(object_path);
return st.st_mode;