Commit 3b83bdac by Vicent Martí

Merge pull request #470 from schu/test-helpers-no-assert

test_helpers: do not rely on assert
parents f8e8c8d4 ec907944
...@@ -116,7 +116,8 @@ int loose_object_mode(const char *repository_folder, git_object *object) ...@@ -116,7 +116,8 @@ int loose_object_mode(const char *repository_folder, git_object *object)
struct stat st; struct stat st;
locate_loose_object(repository_folder, object, &object_path, NULL); 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); free(object_path);
return st.st_mode; return st.st_mode;
...@@ -138,7 +139,8 @@ int loose_object_dir_mode(const char *repository_folder, git_object *object) ...@@ -138,7 +139,8 @@ int loose_object_dir_mode(const char *repository_folder, git_object *object)
} }
} }
assert(p_stat(object_path, &st) == 0); if (p_stat(object_path, &st) < 0)
return 0;
free(object_path); free(object_path);
return st.st_mode; return st.st_mode;
......
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