Skip to content

Commit 5d79a74

Browse files
committed
hotfix
1 parent 16ae98e commit 5d79a74

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/GitVersionCore/GitPreparer.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)