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

Commit def4421

Browse files
authored
Merge pull request #395 from github/fixes/394-clone-dialog-validation
Correctly check for existing repo in clone dialog.
2 parents 61ce70a + 84350c0 commit def4421

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/GitHub.App/ViewModels/RepositoryCloneViewModel.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,14 @@ IObservable<Unit> OnCloneRepository(object state)
171171

172172
bool IsAlreadyRepoAtPath(string path)
173173
{
174+
Debug.Assert(path != null, "RepositoryCloneViewModel.IsAlreadyRepoAtPath cannot be passed null as a path parameter.");
175+
174176
bool isAlreadyRepoAtPath = false;
175177

176178
if (SelectedRepository != null)
177179
{
178-
var validationResult = BaseRepositoryPathValidator.ValidationResult;
179-
if (validationResult != null && validationResult.IsValid)
180-
{
181-
string potentialPath = Path.Combine(path, SelectedRepository.Name);
182-
isAlreadyRepoAtPath = operatingSystem.Directory.Exists(potentialPath);
183-
}
180+
string potentialPath = Path.Combine(path, SelectedRepository.Name);
181+
isAlreadyRepoAtPath = operatingSystem.Directory.Exists(potentialPath);
184182
}
185183

186184
return isAlreadyRepoAtPath;

0 commit comments

Comments
 (0)