diff options
| author | Vicent Marti <vicent@github.com> | 2014-03-26 10:27:42 +0100 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-03-26 10:27:42 +0100 |
| commit | fcbbe1bd82c5e50bcd4a8d31bb68df7fe662026b (patch) | |
| tree | d5fbb688bd2ec9f38f465b6ed97f2e987754ee18 /src | |
| parent | 451aaf866af2d974380a2d141626f450212f40f2 (diff) | |
| parent | 1df8ad01d746ef56c563f82a4f4037957ddc19d8 (diff) | |
| download | libgit2-fcbbe1bd82c5e50bcd4a8d31bb68df7fe662026b.tar.gz | |
Merge pull request #2166 from ethomson/giterr_restore
clone: don't overwrite original error message
Diffstat (limited to 'src')
| -rw-r--r-- | src/clone.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |
