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

Commit 66b7537

Browse files
Merge branch 'enhancements/async-git-setup' into enhancements/git-setup-download
# Conflicts: # src/tests/IntegrationTests/BasePlatformIntegrationTest.cs
2 parents e672ac3 + 9c444b7 commit 66b7537

File tree

2 files changed

+4
-88
lines changed

2 files changed

+4
-88
lines changed

src/GitHub.Api/Application/ApplicationManagerBase.cs

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -110,90 +110,6 @@ public void Run(bool firstRun)
110110
}) );
111111
}
112112

113-
private ITask SetupGit()
114-
{
115-
return BuildDetermineGitPathTask()
116-
.Then((b, path) => {
117-
Logger.Trace("Setting GitExecutablePath: {0}", path);
118-
Environment.GitExecutablePath = path;
119-
})
120-
.Then(() => {
121-
if (Environment.GitExecutablePath == null)
122-
{
123-
if (Environment.IsWindows)
124-
{
125-
GitClient.GetConfig("credential.helper", GitConfigSource.Global).Then(
126-
(b, credentialHelper) => {
127-
if (!string.IsNullOrEmpty(credentialHelper))
128-
{
129-
Logger.Trace("Windows CredentialHelper: {0}", credentialHelper);
130-
}
131-
else
132-
{
133-
Logger.Warning(
134-
"No Windows CredentialHeloper found: Setting to wincred");
135-
136-
GitClient.SetConfig("credential.helper", "wincred", GitConfigSource.Global).Start().Wait();
137-
}
138-
});
139-
}
140-
}
141-
})
142-
.ThenInUI(() => {
143-
Environment.User.Initialize(GitClient);
144-
});
145-
}
146-
147-
private TaskBase<NPath> BuildDetermineGitPathTask()
148-
{
149-
TaskBase<NPath> determinePath = new FuncTask<NPath>(CancellationToken, () => {
150-
if (Environment.GitExecutablePath != null)
151-
{
152-
return Environment.GitExecutablePath;
153-
}
154-
155-
var gitExecutablePath = SystemSettings.Get(Constants.GitInstallPathKey)?.ToNPath();
156-
if (gitExecutablePath != null && gitExecutablePath.FileExists())
157-
{
158-
Logger.Trace("Using git install path from settings");
159-
return gitExecutablePath;
160-
}
161-
162-
return null;
163-
});
164-
165-
var environmentIsWindows = Environment.IsWindows;
166-
if (environmentIsWindows)
167-
{
168-
var applicationDataPath = Environment.GetSpecialFolder(System.Environment.SpecialFolder.LocalApplicationData).ToNPath();
169-
var installDetails = new GitInstallDetails(applicationDataPath, true);
170-
var installTask = new PortableGitInstallTask(CancellationToken, Environment, installDetails);
171-
172-
determinePath = determinePath.Then(new ShortCircuitTask<NPath>(CancellationToken, installTask));
173-
}
174-
175-
if (!environmentIsWindows)
176-
{
177-
determinePath = determinePath.Then(new ShortCircuitTask<NPath>(CancellationToken, () => {
178-
var p = new NPath("/usr/local/bin/git");
179-
180-
if (p.FileExists())
181-
{
182-
return p;
183-
}
184-
185-
return null;
186-
}));
187-
188-
var findExecTask = new FindExecTask("git", CancellationToken);
189-
findExecTask.Configure(ProcessManager);
190-
191-
determinePath = determinePath.Then(new ShortCircuitTask<NPath>(CancellationToken, findExecTask));
192-
}
193-
194-
return determinePath;
195-
}
196-
197113
public ITask InitializeRepository()
198114
{
199115
Logger.Trace("Running Repository Initialize");

src/tests/IntegrationTests/BasePlatformIntegrationTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ protected void InitializePlatform(NPath repoPath, NPath environmentPath, bool en
3838

3939
//var gitInstallTask = new PortableGitInstallTask(CancellationToken.None, Environment, gitArchivePath, gitLfsArchivePath, installDetails);
4040

41-
var installPath = gitInstallTask.Start().Result;
42-
Environment.GitExecutablePath = installPath;
43-
44-
GitClient = new GitClient(Environment, ProcessManager, TaskManager.Token);
41+
//var installPath = gitInstallTask.Start().Result;
42+
//Environment.GitExecutablePath = installPath;
43+
44+
//GitClient = new GitClient(Environment, ProcessManager, TaskManager.Token);
4545
}
4646
}
4747
}

0 commit comments

Comments
 (0)