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

Commit 0e89896

Browse files
Checking for a git-lfs installation after accepting git from user settings
1 parent 390e2e0 commit 0e89896

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Diff for: src/GitHub.Api/Installer/GitInstaller.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,22 @@ public GitInstallationState SetupGitIfNeeded()
4444
Logger.Trace("Using git install path from settings: {0}", gitExecutablePath);
4545
state.GitExecutablePath = gitExecutablePath.Value;
4646
state.GitIsValid = true;
47+
48+
var findTask = new FindExecTask("git-lfs", cancellationToken).Configure(processManager, dontSetupGit: true).Catch(e => true);
49+
var gitLfsPath = findTask.RunWithReturn(true);
50+
state.GitLfsIsValid = findTask.Successful;
51+
if (state.GitLfsIsValid)
52+
{
53+
// we should doublecheck that system git is usable here
54+
state.GitLfsExecutablePath = gitLfsPath;
55+
state.GitLfsInstallationPath = gitLfsPath.Resolve().Parent.Parent;
56+
}
57+
58+
if (state.GitIsValid && state.GitLfsIsValid)
59+
return state;
4760
}
4861
}
4962

50-
5163
if (!environment.IsWindows)
5264
{
5365
return VerifyMacGit(state);

0 commit comments

Comments
 (0)