8000 RepositoryCloneViewModel: Combine if condition. · github/VisualStudio@80198b4 · GitHub
[go: up one dir, main page]

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

Commit 80198b4

Browse files
committed
RepositoryCloneViewModel: Combine if condition.
- RepositoryCloneViewModel: ValidatePathWarning's condition check for empty directory can be combined with directory exists check.
1 parent 1618a86 commit 80198b4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/GitHub.App/ViewModels/Dialog/Clone/RepositoryCloneViewModel.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,10 @@ string ValidatePathWarning(RepositoryModel repositoryModel, string path)
238238
return Resources.DestinationAlreadyExists;
239239
}
240240

241-
if (service.DestinationDirectoryExists(path))
241+
if (service.DestinationDirectoryExists(path) && service.DestinationDirectoryEmpty(path))
242242
{
243243
using (var repository = gitService.GetRepository(path))
244244
{
245-
if (service.DestinationDirectoryEmpty(path))
246-
{
247-
return null;
248-
}
249-
250245
if (repository == null)
251246
{
252247
return Resources.CantFindARepositoryAtLocalPath;

0 commit comments

Comments
 (0)
0