This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Expand file tree Collapse file tree 3 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public UriString(string uriString) : base(NormalizePath(uriString))
51
51
}
52
52
}
53
53
54
- static UriString ToUriString ( Uri uri )
54
+ public static UriString ToUriString ( Uri uri )
55
55
{
56
56
return uri == null ? null : new UriString ( uri . ToString ( ) ) ;
57
57
}
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public static T GetExportedValue<T>(this IServiceProvider serviceProvider)
116
116
}
117
117
}
118
118
119
- public static Uri GetRepoUrlFromSolution ( IVsSolution solution )
119
+ public static UriString GetRepoUrlFromSolution ( IVsSolution solution )
120
120
{
121
121
string solutionDir , solutionFile , userFile ;
122
122
if ( ! ErrorHandler . Succeeded ( solution . GetSolutionInfo ( out solutionDir , out solutionFile , out userFile ) ) )
@@ -128,7 +128,7 @@ public static Uri GetRepoUrlFromSolution(IVsSolution solution)
128
128
return null ;
129
129
using ( var repo = new Repository ( repoPath ) )
130
130
{
131
- return GetUriFromRepository ( repo ) ? . ToRepositoryUrl ( ) ;
131
+ return repo . GetUri ( ) ;
132
132
}
133
133
}
134
134
@@ -145,7 +145,12 @@ public static Repository GetRepoFromSolution(this IVsSolution solution)
145
145
return new Repository ( repoPath ) ;
146
146
}
147
147
148
- public static UriString GetUriFromRepository ( Repository repo )
148
+ public static UriString GetUri ( this Repository repo )
149
+ {
150
+ return UriString . ToUriString ( GetUriFromRepository ( repo ) ? . ToRepositoryUrl ( ) ) ;
151
+ }
152
+
153
+ static UriString GetUriFromRepository ( Repository repo )
149
154
{
150
155
return repo
151
156
? . Network
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ protected virtual void RepoChanged()
48
48
if ( repo != null )
49
49
{
50
50
var gitRepo = repo . GetRepoFromIGit ( ) ;
51
- var uri = Services . GetUriFromRepository ( gitRepo ) ;
52
- var name = uri . RepositoryName ;
51
+ var uri = gitRepo ? . GetUri ( ) ;
52
+ var name = uri ? . RepositoryName ;
53
53
if ( name != null )
54
54
{
55
55
ActiveRepoUri = uri ;
You can’t perform that action at this time.
0 commit comments