Skip to content

Commit cba8b2b

Browse files
committed
Merge pull request #317 from unic/fixCredentials
Fixed libgit2 bug/deprecated
2 parents 3474397 + 6c7814f commit cba8b2b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

GitVersionCore/BuildServers/GitHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static FetchOptions BuildFetchOptions(string username, string password)
101101

102102
if (!string.IsNullOrEmpty(username))
103103
{
104-
fetchOptions.Credentials = new UsernamePasswordCredentials
104+
fetchOptions.CredentialsProvider = (url, user, types) => new UsernamePasswordCredentials
105105
{
106106
Username = username,
107107
Password = password

GitVersionExe/GitPreparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ string GetGitInfoFromUrl()
5757
Logger.WriteInfo(string.Format("Retrieving git info from url '{0}'", arguments.TargetUrl));
5858

5959
Repository.Clone(arguments.TargetUrl, gitDirectory,
60-
new CloneOptions { IsBare = true, Checkout = false, Credentials = credentials});
60+
new CloneOptions { IsBare = true, Checkout = false, CredentialsProvider = (url, user, types) => credentials });
6161

6262
if (!string.IsNullOrWhiteSpace(arguments.TargetBranch))
6363
{

0 commit comments

Comments
 (0)