@@ -13,8 +13,8 @@ public class GitPreparer : IGitPreparer
1313 private readonly ILog log ;
1414 private readonly IEnvironment environment ;
1515 private readonly string dynamicRepositoryLocation ;
16- private readonly AuthenticationInfo authentication ;
1716 private readonly bool noFetch ;
17+ private readonly Arguments arguments ;
1818
1919 private const string DefaultRemoteName = "origin" ;
2020 private string dynamicGitRepositoryPath ;
@@ -23,23 +23,22 @@ public GitPreparer(ILog log, IEnvironment environment, IOptions<Arguments> optio
2323 {
2424 this . log = log ?? throw new ArgumentNullException ( nameof ( log ) ) ;
2525 this . environment = environment ;
26- var arguments = options . Value ;
26+ arguments = options . Value ;
2727
2828 TargetUrl = arguments . TargetUrl ;
2929 WorkingDirectory = arguments . TargetPath . TrimEnd ( '/' , '\\ ' ) ;
3030
3131 dynamicRepositoryLocation = arguments . DynamicRepositoryLocation ;
32- authentication = new AuthenticationInfo
33- {
34- Username = arguments . Authentication ? . Username ,
35- Password = arguments . Authentication ? . Password
36- } ;
37-
3832 noFetch = arguments . NoFetch ;
3933 }
4034
4135 public void Prepare ( bool normalizeGitDirectory , string currentBranch , bool shouldCleanUpRemotes = false )
4236 {
37+ var authentication = new AuthenticationInfo
38+ {
39+ Username = arguments . Authentication ? . Username ,
40+ Password = arguments . Authentication ? . Password
41+ } ;
4342 if ( string . IsNullOrWhiteSpace ( TargetUrl ) )
4443 {
4544 if ( ! normalizeGitDirectory ) return ;
0 commit comments