diff --git a/src/FunFair.BuildVersion.Detection/VersionDetectionSetup.cs b/src/FunFair.BuildVersion.Detection/VersionDetectionSetup.cs index 00536354..3a21f2ed 100644 --- a/src/FunFair.BuildVersion.Detection/VersionDetectionSetup.cs +++ b/src/FunFair.BuildVersion.Detection/VersionDetectionSetup.cs @@ -1,16 +1,14 @@ using FunFair.BuildVersion.Detection.ExternalBranchLocators; using FunFair.BuildVersion.Interfaces; -using LibGit2Sharp; using Microsoft.Extensions.DependencyInjection; namespace FunFair.BuildVersion.Detection; public static class VersionDetectionSetup { - public static IServiceCollection AddBuildVersionDetection(this IServiceCollection services, Repository repo, IBranchSettings branchSettings) + public static IServiceCollection AddBuildVersionDetection(this IServiceCollection services, IBranchSettings branchSettings) { return services.AddSingleton(branchSettings) - .AddSingleton(repo) .AddSingleton() .AddSingleton() .AddSingleton() diff --git a/src/FunFair.BuildVersion/Program.cs b/src/FunFair.BuildVersion/Program.cs index 17c7378c..d801ccd1 100644 --- a/src/FunFair.BuildVersion/Program.cs +++ b/src/FunFair.BuildVersion/Program.cs @@ -38,7 +38,7 @@ private static int ParsedOk(Options options) using (Repository repository = OpenRepository(workDir)) { - IServiceProvider serviceProvider = Setup(options: options, repo: repository); + IServiceProvider serviceProvider = Setup(options: options); IDiagnosticLogger logging = serviceProvider.GetRequiredService(); IVersionDetector versionDetector = serviceProvider.GetRequiredService(); @@ -89,7 +89,7 @@ public static int Main(params string[] args) } } - private static IServiceProvider Setup(Options options, Repository repo) + private static IServiceProvider Setup(Options options) { IServiceCollection services = new ServiceCollection(); DiagnosticLogger logger = new(options.WarningsAsErrors); @@ -99,7 +99,7 @@ private static IServiceProvider Setup(Options options, Repository repo) services.AddSingleton(logger) .AddSingleton(logger) .AddSingleton(typeof(ILogger<>), typeof(LoggerProxy<>)) - .AddBuildVersionDetection(repo: repo, branchSettings: branchSettings) + .AddBuildVersionDetection(branchSettings: branchSettings) .AddSingleton() .AddSingleton();