File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ public static bool IsValidURL(string url)
5050 return true ;
5151 }
5252
53- return url . StartsWith ( "file://" , StringComparison . Ordinal ) || Directory . Exists ( url ) ;
53+ return url . StartsWith ( "file://" , StringComparison . Ordinal ) ||
54+ url . StartsWith ( "./" , StringComparison . Ordinal ) ||
55+ url . StartsWith ( "../" , StringComparison . Ordinal ) ||
56+ Directory . Exists ( url ) ;
5457 }
5558
5659 public bool TryGetVisitURL ( out string url )
Original file line number Diff line number Diff line change @@ -34,17 +34,10 @@ public AddSubmodule(Repository repo)
3434
3535 public static ValidationResult ValidateURL ( string url , ValidationContext ctx )
3636 {
37- if ( ctx . ObjectInstance is AddSubmodule )
38- {
39- if ( ! Models . Remote . IsValidURL ( url ) &&
40- ! url . StartsWith ( "./" , StringComparison . Ordinal ) &&
41- ! url . StartsWith ( "../" , StringComparison . Ordinal ) )
42- return new ValidationResult ( "Invalid repository URL format" ) ;
43-
44- return ValidationResult . Success ;
45- }
46-
47- return new ValidationResult ( "Missing validation context" ) ;
37+ if ( ! Models . Remote . IsValidURL ( url ) )
38+ return new ValidationResult ( "Invalid repository URL format" ) ;
39+
40+ return ValidationResult . Success ;
4841 }
4942
5043 public override Task < bool > Sure ( )
You can’t perform that action at this time.
0 commit comments