Commit 252840a5 by Brodie Rao

tests: propagate errors from open_temp_repo() instead of exiting

This makes it slightly easier to debug test failures when one test
opens a repo, has a failure, and doesn't get a chance to close it for
the next test. Now, instead of getting no feedback, we at least see
test failure information.
parent 1776f5ab
...@@ -217,10 +217,9 @@ int copydir_recurs(const char *source_directory_path, const char *destination_di ...@@ -217,10 +217,9 @@ int copydir_recurs(const char *source_directory_path, const char *destination_di
int open_temp_repo(git_repository **repo, const char *path) int open_temp_repo(git_repository **repo, const char *path)
{ {
if (copydir_recurs(path, TEMP_REPO_FOLDER) < GIT_SUCCESS) { int error;
printf("\nFailed to create temporary folder. Aborting test suite.\n"); if ((error = copydir_recurs(path, TEMP_REPO_FOLDER)) < GIT_SUCCESS)
exit(-1); return error;
}
return git_repository_open(repo, TEMP_REPO_FOLDER); return git_repository_open(repo, TEMP_REPO_FOLDER);
} }
......
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