Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 5812483

Browse files
Merge branch 'master' into fixes/create-branch-NRE
2 parents 9f084e1 + bf36e06 commit 5812483

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ fi
3434

3535
xbuild GitHub.Unity.sln /property:Configuration=$Configuration /target:$Target
3636

37+
cp -r unity/PackageProject/Assets/Editor/GitHub ../github-unity-test/GitHubExtensionProject/Assets/Editor || true
38+
3739
rm -f unity/PackageProject/Assets/Editor/GitHub/deleteme*
3840
rm -f unity/PackageProject/Assets/Editor/GitHub/deleteme*
3941
rm -f unity/PackageProject/Assets/Editor/GitHub/*.xml

src/GitHub.Api/ApplicationManagerBase.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,28 @@ private async Task RunInternal()
119119
logger.Trace("Environment.GitExecutablePath \"{0}\" Exists:{1}", gitSetup.GitExecutablePath, gitSetup.GitExecutablePath.FileExists());
120120

121121
await RestartRepository();
122-
}
122+
123+
if (Environment.IsWindows)
124+
{
125+
string credentialHelper = null;
126+
var gitConfigGetTask = new GitConfigGetTask(Environment, ProcessManager,
127+
new TaskResultDispatcher<string>(s => {
128+
credentialHelper = s;
129+
}), "credential.helper", GitConfigSource.Global);
123130

124131

132+
await gitConfigGetTask.RunAsync(CancellationToken.None);
133+
134+
if (string.IsNullOrEmpty(credentialHelper))
135+
{
136+
var gitConfigSetTask = new GitConfigSetTask(Environment, ProcessManager,
137+
new TaskResultDispatcher<string>(s => { }), "credential.helper", "wincred",
138+
GitConfigSource.Global);
139+
140+
await gitConfigSetTask.RunAsync(CancellationToken.None);
141+
}
142+
}
143+
}
125144

126145
private async Task<string> LookForGitInstallationPath()
127146
{

src/UnityExtension/Assets/Editor/GitHub.Unity/EntryPoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class EntryPoint : ScriptableObject
1818
// this may run on the loader thread if it's an appdomain restart
1919
static EntryPoint()
2020
{
21+
Logging.LoggerFactory = s => new UnityLogAdapter(s);
2122
if (System.Environment.GetEnvironmentVariable("GITHUB_UNITY_DISABLE") == "1")
2223
{
2324
Debug.Log("GitHub for Unity " + ApplicationInfo.Version + " is disabled");
@@ -29,7 +30,6 @@ static EntryPoint()
2930
return;
3031
}
3132
cctorCalled = true;
32-
Logging.LoggerFactory = s => new UnityLogAdapter(s);
3333
Logging.Info("Initializing GitHub for Unity version " + ApplicationInfo.Version);
3434

3535
ServicePointManager.ServerCertificateValidationCallback = ServerCertificateValidationCallback;

0 commit comments

Comments
 (0)