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

Explicitly open repository when clone completes #2004

Merged
merged 2 commits into from
Oct 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/GitHub.TeamFoundation.14/Services/VSGitServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class VSGitServices : IVSGitServices
[SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2017")]
readonly Lazy<IStatusBarNotificationService> statusBar;
[SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2015")]
readonly Lazy<IVSServices> vsServices;
readonly Lazy<ITeamExplorerServices> teamExplorerServices;

/// <summary>
/// This MEF export requires specific versions of TeamFoundation. IGitExt is declared here so
Expand All @@ -50,11 +50,11 @@ public class VSGitServices : IVSGitServices
[ImportingConstructor]
public VSGitServices(IGitHubServiceProvider serviceProvider,
Lazy<IStatusBarNotificationService> statusBar,
Lazy<IVSServices> vsServices)
Lazy<ITeamExplorerServices> teamExplorerServices)
{
this.serviceProvider = serviceProvider;
this.statusBar = statusBar;
this.vsServices = vsServices;
this.teamExplorerServices = teamExplorerServices;
}

// The Default Repository Path that VS uses is hidden in an internal
Expand Down Expand Up @@ -90,7 +90,6 @@ public async Task Clone(
await StartClonenOnConnectPageAsync(teamExplorer, cloneUrl, clonePath, recurseSubmodules);
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
await WaitForCloneOnHomePageAsync(teamExplorer);
vsServices.Value.TryOpenRepository(clonePath); // Show the repository on Team Explorer - Home
#else
var gitExt = serviceProvider.GetService<IGitActionsExt>();
var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>();
Expand All @@ -100,6 +99,8 @@ public async Task Clone(
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
await cloneTask;
#endif
// Change Team Explorer context to the newly cloned repository
teamExplorerServices.Value.OpenRepository(clonePath);
}

static async Task StartClonenOnConnectPageAsync(
Expand Down