feat(git-provider): Initial Show-GitRepo implementation

This commit is contained in:
Scott 2026-08-23 09:53:33 +10:00
commit 740d35d3e7
2 changed files with 60 additions and 0 deletions

View file

@ -57,6 +57,21 @@ public class GitManager
{
return _registrations.Select(x => new GitReg() { Name = x.Value.Name, Location = x.Value.Location }).ToList();
}
public string GetRepo(string? registeredName)
{
if (string.IsNullOrEmpty(registeredName))
{
throw new Exception("Name cannot be null");
}
if (_registrations.TryGetValue(registeredName, out var registration))
{
return registration.Location;
}
throw new Exception($"No git repo has been registered with the name {registeredName}");
}
}
public class GitReg