From 1df8ad01d746ef56c563f82a4f4037957ddc19d8 Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Thu, 6 Mar 2014 16:00:52 -0800 Subject: [PATCH] clone: don't overwrite original error message --- src/clone.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/clone.c b/src/clone.c index e19d02ba2..62f103561 100644 --- a/src/clone.c +++ b/src/clone.c @@ -430,10 +430,15 @@ int git_clone( } if (error != 0) { + git_error_state last_error = {0}; + giterr_capture(&last_error, error); + git_repository_free(repo); repo = NULL; (void)git_futils_rmdir_r(local_path, NULL, rmdir_flags); + + giterr_restore(&last_error); } *out = repo;