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))
5151 }
5252 }
5353
54- static UriString ToUriString ( Uri uri )
54+ public static UriString ToUriString ( Uri uri )
5555 {
5656 return uri == null ? null : new UriString ( uri . ToString ( ) ) ;
5757 }
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ public static T GetExportedValue<T>(this IServiceProvider serviceProvider)
116116 }
117117 }
118118
119- public static Uri GetRepoUrlFromSolution ( IVsSolution solution )
119+ public static UriString GetRepoUrlFromSolution ( IVsSolution solution )
120120 {
121121 string solutionDir , solutionFile , userFile ;
122122 if ( ! ErrorHandler . Succeeded ( solution . GetSolutionInfo ( out solutionDir , out solutionFile , out userFile ) ) )
@@ -128,7 +128,7 @@ public static Uri GetRepoUrlFromSolution(IVsSolution solution)
128128 return null ;
129129 using ( var repo = new Repository ( repoPath ) )
130130 {
131- return GetUriFromRepository ( repo ) ? . ToRepositoryUrl ( ) ;
131+ return repo . GetUri ( ) ;
132132 }
133133 }
134134
@@ -145,7 +145,12 @@ public static Repository GetRepoFromSolution(this IVsSolution solution)
145145 return new Repository ( repoPath ) ;
146146 }
147147
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 )
149154 {
150155 return repo
151156 ? . Network
Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ protected virtual void RepoChanged()
4848 if ( repo != null )
4949 {
5050 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 ;
5353 if ( name != null )
5454 {
5555 ActiveRepoUri = uri ;
You can’t perform that action at this time.
0 commit comments