Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit b42e08e

Browse files
committed
Fix residual empty directory when clone fails.
- Currently an empty directory will be created when trying to clone non-existant remote repo. - This commit adds an action to delete the repo directory if an exception occurs while cloning.
1 parent 13fa0bd commit b42e08e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ public async Task CloneRepository(
223223
}
224224
catch (Exception ex)
225225
{
226+
operatingSystem.Directory.DeleteDirectory(repositoryPath);
226227
log.Error(ex, "Could not clone {CloneUrl} to {Path}", cloneUrl, repositoryPath);
227228
throw;
228229
}

0 commit comments

Comments
 (0)