@@ -15,7 +15,9 @@ class GitPathView : Subview
15
15
private const string BrowseButton = "..." ;
16
16
private const string GitInstallBrowseTitle = "Select git binary" ;
17
17
private const string ErrorInvalidPathMessage = "Invalid Path." ;
18
- private const string ErrorGettingSoftwareVersionMessage = "Error getting software versions." ;
18
+ private const string ErrorValidatingGitPath = "Error validating Git Path." ;
19
+ private const string ErrorGitNotFoundMessage = "Git not found." ;
20
+ private const string ErrorGitLfsNotFoundMessage = "Git LFS not found." ;
19
21
private const string ErrorMinimumGitVersionMessageFormat = "Git version {0} found. Git version {1} is required." ;
20
22
private const string ErrorMinimumGitLfsVersionMessageFormat = "Git LFS version {0} found. Git LFS version {1} is required." ;
21
23
@@ -220,8 +222,8 @@ private void ValidateAndSetGitInstallPath(string value)
220
222
{
221
223
if ( ! sucess )
222
224
{
223
- Logger . Trace ( ErrorGettingSoftwareVersionMessage ) ;
224
- gitVersionErrorMessage = ErrorGettingSoftwareVersionMessage ;
225
+ Logger . Trace ( ErrorValidatingGitPath ) ;
226
+ gitVersionErrorMessage = ErrorValidatingGitPath ;
225
227
}
226
228
else if ( ! result . IsValid )
227
229
{
@@ -232,21 +234,32 @@ private void ValidateAndSetGitInstallPath(string value)
232
234
233
235
var errorMessageStringBuilder = new StringBuilder ( ) ;
234
236
235
- if ( result . GitVersion < Constants . MinimumGitVersion )
237
+ if ( result . GitVersion == null )
236
238
{
237
- errorMessageStringBuilder . AppendFormat ( ErrorMinimumGitVersionMessageFormat ,
238
- result . GitVersion , Constants . MinimumGitVersion ) ;
239
+ errorMessageStringBuilder . Append ( ErrorGitNotFoundMessage ) ;
239
240
}
240
-
241
- if ( result . GitLfsVersion < Constants . MinimumGitLfsVersion )
241
+ else if ( result . GitLfsVersion == null )
242
+ {
243
+ errorMessageStringBuilder . Append ( ErrorGitLfsNotFoundMessage ) ;
244
+ }
245
+ else
242
246
{
243
- if ( errorMessageStringBuilder . Length > 0 )
247
+ if ( result . GitVersion < Constants . MinimumGitVersion )
244
248
{
245
- errorMessageStringBuilder . Append ( Environment . NewLine ) ;
249
+ errorMessageStringBuilder . AppendFormat ( ErrorMinimumGitVersionMessageFormat ,
250
+ result . GitVersion , Constants . MinimumGitVersion ) ;
246
251
}
247
252
248
- errorMessageStringBuilder . AppendFormat ( ErrorMinimumGitLfsVersionMessageFormat ,
249
- result . GitLfsVersion , Constants . MinimumGitLfsVersion ) ;
253
+ if ( result . GitLfsVersion < Constants . MinimumGitLfsVersion )
254
+ {
255
+ if ( errorMessageStringBuilder . Length > 0 )
256
+ {
257
+ errorMessageStringBuilder . Append ( Environment . NewLine ) ;
258
+ }
259
+
260
+ errorMessageStringBuilder . AppendFormat ( ErrorMinimumGitLfsVersionMessageFormat ,
261
+ result . GitLfsVersion , Constants . MinimumGitLfsVersion ) ;
262
+ }
250
263
}
251
264
252
265
gitVersionErrorMessage = errorMessageStringBuilder . ToString ( ) ;
0 commit comments