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

Commit 5086721

Browse files
committed
No need to validate path here
The path is only required to be valid if it happens to get used, which is not always the case for this constructor. It's already being validated when it gets used, so avoid doing IO here.
1 parent 6bff574 commit 5086721

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/GitHub.Exports/Models/SimpleRepositoryModel.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ public class SimpleRepositoryModel : NotificationAwareObject, ISimpleRepositoryM
1414
{
1515
public SimpleRepositoryModel(string name, UriString cloneUrl, string localPath = null)
1616
{
17-
if (localPath != null && !Directory.Exists(localPath))
18-
throw new ArgumentException("Malformed path", localPath);
1917
Name = name;
2018
CloneUrl = cloneUrl;
2119
LocalPath = localPath;
@@ -27,7 +25,7 @@ public SimpleRepositoryModel(string path)
2725
if (path == null)
2826
throw new ArgumentNullException("path");
2927
if (!Directory.Exists(path))
30-
throw new ArgumentException("Malformed path", path);
28+
throw new ArgumentException("Path does not exist", path);
3129
var uri = GitHelpers.GetRepoFromPath(path)?.GetUri();
3230
var name = uri?.NameWithOwner;
3331
if (name == null)

0 commit comments

Comments
 (0)