@@ -13,8 +13,8 @@ public class GitPreparer : IGitPreparer
13
13
private readonly ILog log ;
14
14
private readonly IEnvironment environment ;
15
15
private readonly string dynamicRepositoryLocation ;
16
- private readonly AuthenticationInfo authentication ;
17
16
private readonly bool noFetch ;
17
+ private readonly Arguments arguments ;
18
18
19
19
private const string DefaultRemoteName = "origin" ;
20
20
private string dynamicGitRepositoryPath ;
@@ -23,23 +23,22 @@ public GitPreparer(ILog log, IEnvironment environment, IOptions<Arguments> optio
23
23
{
24
24
this . log = log ?? throw new ArgumentNullException ( nameof ( log ) ) ;
25
25
this . environment = environment ;
26
- var arguments = options . Value ;
26
+ arguments = options . Value ;
27
27
28
28
TargetUrl = arguments . TargetUrl ;
29
29
WorkingDirectory = arguments . TargetPath . TrimEnd ( '/' , '\\ ' ) ;
30
30
31
31
dynamicRepositoryLocation = arguments . DynamicRepositoryLocation ;
32
- authentication = new AuthenticationInfo
33
- {
34
- Username = arguments . Authentication ? . Username ,
35
- Password = arguments . Authentication ? . Password
36
- } ;
37
-
38
32
noFetch = arguments . NoFetch ;
39
33
}
40
34
41
35
public void Prepare ( bool normalizeGitDirectory , string currentBranch , bool shouldCleanUpRemotes = false )
42
36
{
37
+ var authentication = new AuthenticationInfo
38
+ {
39
+ Username = arguments . Authentication ? . Username ,
40
+ Password = arguments . Authentication ? . Password
41
+ } ;
43
42
if ( string . IsNullOrWhiteSpace ( TargetUrl ) )
44
43
{
45
44
if ( ! normalizeGitDirectory ) return ;
0 commit comments