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)
50
50
return true ;
51
51
}
52
52
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 ) ;
54
57
}
55
58
56
59
public bool TryGetVisitURL ( out string url )
Original file line number Diff line number Diff line change @@ -34,17 +34,10 @@ public AddSubmodule(Repository repo)
34
34
35
35
public static ValidationResult ValidateURL ( string url , ValidationContext ctx )
36
36
{
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 ;
48
41
}
49
42
50
43
public override Task < bool > Sure ( )
You can’t perform that action at this time.
0 commit comments