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

Commit c613f64

Browse files
Functionality to validate git versions
1 parent 9049261 commit c613f64

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/UnityExtension/Assets/Editor/GitHub.Unity/UI/GitPathView.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,24 @@ public override void OnGUI()
142142

143143
private void ValidateAndSetGitInstallPath(string value)
144144
{
145-
Manager.SystemSettings.Set(Constants.GitInstallPathKey, value);
146-
Environment.GitExecutablePath = value.ToNPath();
147-
gitExecHasChanged = true;
145+
GitClient.ValidateGitInstall(value).Then((sucess, result) => {
146+
if (!sucess)
147+
{
148+
Logger.Trace("Error getting software versions");
149+
return;
150+
}
151+
152+
if (!result.IsValid)
153+
{
154+
Logger.Warning("Software versions do not meet minimums Git:{0} GitLfs:{1}", result.GitVersionTask, result.GitLfsVersionTask);
155+
return;
156+
}
157+
158+
Manager.SystemSettings.Set(Constants.GitInstallPathKey, value);
159+
Environment.GitExecutablePath = value.ToNPath();
160+
161+
gitExecHasChanged = true;
162+
});
148163
}
149164

150165
private void MaybeUpdateData()

0 commit comments

Comments
 (0)