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

Commit a1dc901

Browse files
authored
Merge branch 'master' into FixDiffCaptions
2 parents 8b13681 + c56f7f2 commit a1dc901

7 files changed

+25
-0
lines changed
7.05 KB
Binary file not shown.
-7.45 KB
Binary file not shown.
98.3 KB
Binary file not shown.
-6.77 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

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

+25
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using EnvDTE;
1010
using GitHub.VisualStudio.TeamExplorer.Sync;
1111
using Microsoft.TeamFoundation.Controls;
12+
using Microsoft.VisualStudio.TeamFoundation.Git.Extensibility;
1213
using ReactiveUI;
1314

1415
namespace GitHub.Services
@@ -66,12 +67,36 @@ public void ShowHomePage()
6667

6768
public void ShowPublishSection()
6869
{
70+
#if TEAMEXPLORER16
71+
// Only call InitializeOrPushRepositoryToGitService when IGitActionsExt2 exists
72+
if (FindIGitActionsExt2() is object)
73+
{
74+
InitializeOrPushRepositoryToGitService();
75+
return;
76+
}
77+
#endif
78+
6979
var te = serviceProvider.TryGetService<ITeamExplorer>();
7080
var page = te.NavigateToPage(new Guid(TeamExplorerPageIds.GitCommits), null);
7181
var publish = page?.GetSection(new Guid(GitHubPublishSection.GitHubPublishSectionId)) as GitHubPublishSection;
7282
publish?.Connect();
7383
}
7484

85+
#if TEAMEXPLORER16
86+
private static Type FindIGitActionsExt2()
87+
{
88+
Type type = typeof(IGitActionsExt);
89+
string name = $"{type.FullName}2";
90+
return type.Assembly.GetType(name, false);
91+
}
92+
93+
private void InitializeOrPushRepositoryToGitService()
94+
{
95+
IGitActionsExt2 gitActionsExt = serviceProvider.TryGetService<IGitActionsExt2>();
96+
gitActionsExt?.InitializeOrPushRepositoryToGitService();
97+
}
98+
#endif
99+
75100
public async Task ShowRepositorySettingsRemotesAsync()
76101
{
77102
var te = serviceProvider.TryGetService<ITeamExplorer>();

0 commit comments

Comments
 (0)