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

Commit fa9ba8c

Browse files
committed
Fix setting the name from the path
1 parent 7dd53df commit fa9ba8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/GitHub.Exports/Models/SimpleRepositoryModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ public SimpleRepositoryModel(string path)
2525
{
2626
if (path == null)
2727
throw new ArgumentNullException("path");
28-
if (!Directory.Exists(path))
28+
var dir = new DirectoryInfo(path);
29+
if (!dir.Exists)
2930
throw new ArgumentException("Path does not exist", path);
3031
var uri = VisualStudio.Services.GetRepoFromPath(path)?.GetUri();
3132
var name = uri?.NameWithOwner;
3233
if (name == null)
33-
name = Path.GetDirectoryName(name);
34+
name = dir.Name;
3435
Name = name;
3536
LocalPath = path;
3637
CloneUrl = uri;

0 commit comments

Comments
 (0)