Commit 1df8ad01 by Edward Thomson

clone: don't overwrite original error message

parent f2f2d97f
...@@ -430,10 +430,15 @@ int git_clone( ...@@ -430,10 +430,15 @@ int git_clone(
} }
if (error != 0) { if (error != 0) {
git_error_state last_error = {0};
giterr_capture(&last_error, error);
git_repository_free(repo); git_repository_free(repo);
repo = NULL; repo = NULL;
(void)git_futils_rmdir_r(local_path, NULL, rmdir_flags); (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags);
giterr_restore(&last_error);
} }
*out = repo; *out = repo;
......
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