From 252840a59f09a62bd358c90593724af36a703161 Mon Sep 17 00:00:00 2001 From: Brodie Rao Date: Thu, 11 Aug 2011 15:18:04 -0700 Subject: [PATCH] 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. --- tests/test_helpers.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_helpers.c b/tests/test_helpers.c index 0900430e1..cb95607e1 100644 --- a/tests/test_helpers.c +++ b/tests/test_helpers.c @@ -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) { - if (copydir_recurs(path, TEMP_REPO_FOLDER) < GIT_SUCCESS) { - printf("\nFailed to create temporary folder. Aborting test suite.\n"); - exit(-1); - } + int error; + if ((error = copydir_recurs(path, TEMP_REPO_FOLDER)) < GIT_SUCCESS) + return error; return git_repository_open(repo, TEMP_REPO_FOLDER); }