mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor(archival): ♻ simplify GitOptions fetch in git service registration
This commit is contained in:
parent
0e81d15f0c
commit
d383d28e67
1 changed files with 1 additions and 3 deletions
|
|
@ -12,9 +12,7 @@ public static void AddPersistenceServices(this IServiceCollection services, ICon
|
|||
services.Configure<GitOptions>(configuration.GetSection(GitOptions.Key));
|
||||
services.AddTransient<IRepository, Repository>(_ =>
|
||||
{
|
||||
var gitOptions = new GitOptions();
|
||||
configuration.GetSection(GitOptions.Key).Bind(gitOptions);
|
||||
|
||||
var gitOptions = configuration.GetSection(GitOptions.Key).Get<GitOptions>();
|
||||
if (!Repository.IsValid(gitOptions.RepositoryPath))
|
||||
{
|
||||
Repository.Init(gitOptions.RepositoryPath);
|
||||
|
|
|
|||
Loading…
Reference in a new issue