Skip to content

Commit 1df8ad0

Browse files
author
Edward Thomson
committed
clone: don't overwrite original error message
1 parent f2f2d97 commit 1df8ad0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/clone.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,15 @@ int git_clone(
430430
}
431431

432432
if (error != 0) {
433+
git_error_state last_error = {0};
434+
giterr_capture(&last_error, error);
435+
433436
git_repository_free(repo);
434437
repo = NULL;
435438

436439
(void)git_futils_rmdir_r(local_path, NULL, rmdir_flags);
440+
441+
giterr_restore(&last_error);
437442
}
438443

439444
*out = repo;

0 commit comments

Comments
 (0)