File tree Expand file tree Collapse file tree 6 files changed +7
-9
lines changed
GitVersion.Core.Tests/Core Expand file tree Collapse file tree 6 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -695,9 +695,8 @@ private static IServiceProvider GetServiceProvider(GitVersionOptions gitVersionO
695695 services . AddSingleton < IGitVersionContextFactory , GitVersionContextFactory > ( ) ;
696696 services . AddSingleton ( sp =>
697697 {
698- var options = sp . GetRequiredService < IOptions < GitVersionOptions > > ( ) ;
699698 var contextFactory = sp . GetRequiredService < IGitVersionContextFactory > ( ) ;
700- return new Lazy < GitVersionContext > ( ( ) => contextFactory . Create ( options . Value ) ) ;
699+ return new Lazy < GitVersionContext > ( ( ) => contextFactory . Create ( ) ) ;
701700 } ) ;
702701 if ( log != null ) services . AddSingleton ( log ) ;
703702 if ( fileSystem != null ) services . AddSingleton ( fileSystem ) ;
Original file line number Diff line number Diff line change @@ -2,5 +2,5 @@ namespace GitVersion;
22
33public interface IGitVersionContextFactory
44{
5- GitVersionContext Create ( GitVersionOptions gitVersionOptions ) ;
5+ GitVersionContext Create ( ) ;
66}
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ internal class GitVersionContextFactory(
1818 private readonly ITaggedSemanticVersionRepository taggedSemanticVersionRepository = taggedSemanticVersionRepository . NotNull ( ) ;
1919 private readonly IOptions < GitVersionOptions > options = options . NotNull ( ) ;
2020
21- public GitVersionContext Create ( GitVersionOptions gitVersionOptions )
21+ public GitVersionContext Create ( )
2222 {
23- var overrideConfiguration = this . options . Value . ConfigurationInfo . OverrideConfiguration ;
23+ var gitVersionOptions = this . options . Value ;
24+ var overrideConfiguration = gitVersionOptions . ConfigurationInfo . OverrideConfiguration ;
2425 var configuration = this . configurationProvider . Provide ( overrideConfiguration ) ;
2526
2627 var currentBranch = this . repositoryStore . GetTargetBranch ( gitVersionOptions . RepositoryInfo . TargetBranch )
Original file line number Diff line number Diff line change 44using GitVersion . VersionCalculation ;
55using GitVersion . VersionCalculation . Caching ;
66using Microsoft . Extensions . DependencyInjection ;
7- using Microsoft . Extensions . Options ;
87
98namespace GitVersion ;
109
@@ -25,9 +24,8 @@ public void RegisterTypes(IServiceCollection services)
2524 services . AddSingleton < IGitVersionContextFactory , GitVersionContextFactory > ( ) ;
2625 services . AddSingleton ( sp =>
2726 {
28- var options = sp . GetRequiredService < IOptions < GitVersionOptions > > ( ) ;
2927 var contextFactory = sp . GetRequiredService < IGitVersionContextFactory > ( ) ;
30- return new Lazy < GitVersionContext > ( ( ) => contextFactory . Create ( options . Value ) ) ;
28+ return new Lazy < GitVersionContext > ( ( ) => contextFactory . Create ( ) ) ;
3129 } ) ;
3230
3331 services . AddModule ( new GitVersionCommonModule ( ) ) ;
Original file line number Diff line number Diff line change @@ -364,7 +364,6 @@ GitVersion.IGitPreparer.Prepare() -> void
364364GitVersion.IGitVersionCalculateTool
365365GitVersion.IGitVersionCalculateTool.CalculateVersionVariables() -> GitVersion.OutputVariables.GitVersionVariables!
366366GitVersion.IGitVersionContextFactory
367- GitVersion.IGitVersionContextFactory.Create(GitVersion.GitVersionOptions! gitVersionOptions) -> GitVersion.GitVersionContext!
368367GitVersion.IGitVersionModule
369368GitVersion.IGitVersionModule.FindAllDerivedTypes<T>(System.Reflection.Assembly? assembly) -> System.Collections.Generic.IEnumerable<System.Type!>!
370369GitVersion.IGitVersionModule.RegisterTypes(Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> void
Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ GitVersion.Common.IRepositoryStore.GetCommitsReacheableFrom(GitVersion.Git.IComm
33GitVersion.Git.ICommit.Id.get -> GitVersion.Git.IObjectId!
44GitVersion.Git.ICommit.Sha.get -> string!
55GitVersion.Git.IGitRepository.References.get -> GitVersion.Git.IReferenceCollection!
6+ GitVersion.IGitVersionContextFactory.Create() -> GitVersion.GitVersionContext!
You can’t perform that action at this time.
0 commit comments