public static Uri GetRemoteUriFromLocalRepo(this Uri repositoryUri, IGitDiscoveryDriver discoveryDriver, string shouldMatchTo) { if (discoveryDriver.IsGitRepo(repositoryUri)) { // Check the origin remotes var origin = discoveryDriver.GetRemoteForPlatform(repositoryUri, shouldMatchTo); if (origin != null) { return(origin.Url); } } return(repositoryUri); }
public AzureDevOpsSettingsReader(IGitDiscoveryDriver gitDriver, IEnvironmentVariablesProvider environmentVariablesProvider) : base(environmentVariablesProvider) { _gitDriver = gitDriver; }
public GitHubSettingsReader(IGitDiscoveryDriver gitDriver, IEnvironmentVariablesProvider environmentVariablesProvider) { _environmentVariablesProvider = environmentVariablesProvider; _gitDriver = gitDriver; }
public AzureDevOpsSettingsReader(IGitDiscoveryDriver gitDriver) { _gitDriver = gitDriver; }
public static async Task <Uri> GetRemoteUriFromLocalRepo(this Uri repositoryUri, IGitDiscoveryDriver discoveryDriver, string shouldMatchTo) { if (discoveryDriver == null) { throw new ArgumentNullException(nameof(discoveryDriver)); } if (await discoveryDriver.IsGitRepo(repositoryUri)) { // Check the origin remotes var origin = await discoveryDriver.GetRemoteForPlatform(repositoryUri, shouldMatchTo); if (origin != null) { return(origin.Url); } } return(repositoryUri); }
public TfsSettingsReader(IGitDiscoveryDriver gitDriver) { _gitDriver = gitDriver; }
public void Setup() { _environmentVariablesProvider = Substitute.For <IEnvironmentVariablesProvider>(); _gitDiscovery = Substitute.For <IGitDiscoveryDriver>(); _giteaSettingsReader = new GiteaSettingsReader(_gitDiscovery, _environmentVariablesProvider); }