Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4207f51

Browse files
committed
Get the Git SccService before IGitActionsExt
IGitActionsExt is proffered by SccProviderPackage, but isn't advertised. To ensure that getting IGitActionsExt doesn't return null, we first request the SccService which is advertised. This forces SccProviderPackage to load and proffer IGitActionsExt.
1 parent dbf983f commit 4207f51

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/GitHub.TeamFoundation.14/Services/VSGitServices.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ public async Task Clone(
8686
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
8787
await WaitForCloneOnHomePageAsync(teamExplorer);
8888
#elif TEAMEXPLORER15 || TEAMEXPLORER16
89+
// IGitActionsExt is proffered by SccProviderPackage, but isn't advertised.
90+
// To ensure that getting IGitActionsExt doesn't return null, we first request the
91+
// SccService which is advertised. This forces SccProviderPackage to load
92+
// 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+
}
100+
89101
// The progress parameter uses the ServiceProgressData type which is defined in
90102
// Microsoft.VisualStudio.Shell.Framework. Referencing this assembly directly
91103
// would cause type conflicts, so we're using reflection to call CloneAsync.

0 commit comments

Comments
 (0)