@@ -88,24 +88,20 @@ public async Task Clone(
8888#elif TEAMEXPLORER15 || TEAMEXPLORER16
8989 // IGitActionsExt is proffered by SccProviderPackage, but isn't advertised.
9090 // To ensure that getting IGitActionsExt doesn't return null, we first request the
91- // SccService which is advertised. This forces SccProviderPackage to load
91+ // IGitExt service which is advertised. This forces SccProviderPackage to load
9292 // and proffer IGitActionsExt.
93- var gitSccServiceGuid = new Guid ( "28C35EB2-67EA-4C5F-B49D-DACF73A66989" ) ;
94- var gitSccServiceType = Type . GetTypeFromCLSID ( gitSccServiceGuid ) ;
95- var gitSccService = serviceProvider . GetService ( gitSccServiceType ) ;
96- if ( gitSccService is null )
97- {
98- log . Warning ( "Couldn't find Git SccService with Guid {Guid}" , gitSccServiceGuid ) ;
99- }
93+ var gitExt = serviceProvider . GetService ( typeof ( IGitExt ) ) ;
94+ Assumes . NotNull ( gitExt ) ;
95+ var gitActionsExt = serviceProvider . GetService < IGitActionsExt > ( ) ;
96+ Assumes . NotNull ( gitActionsExt ) ;
10097
10198 // The progress parameter uses the ServiceProgressData type which is defined in
10299 // Microsoft.VisualStudio.Shell.Framework. Referencing this assembly directly
103100 // would cause type conflicts, so we're using reflection to call CloneAsync.
104- var gitExt = serviceProvider . GetService < IGitActionsExt > ( ) ;
105101 var cloneAsyncMethod = typeof ( IGitActionsExt ) . GetMethod ( nameof ( IGitActionsExt . CloneAsync ) ) ;
106102 Assumes . NotNull ( cloneAsyncMethod ) ;
107103 var cloneParameters = new object [ ] { cloneUrl , clonePath , recurseSubmodules , cancellationToken , progress } ;
108- var cloneTask = ( Task ) cloneAsyncMethod . Invoke ( gitExt , cloneParameters ) ;
104+ var cloneTask = ( Task ) cloneAsyncMethod . Invoke ( gitActionsExt , cloneParameters ) ;
109105
110106 NavigateToHomePage ( teamExplorer ) ; // Show progress on Team Explorer - Home
111107 await cloneTask ;
0 commit comments