diff --git a/src/GitHub.TeamFoundation.14/Services/VSGitServices.cs b/src/GitHub.TeamFoundation.14/Services/VSGitServices.cs index b51862deb1..1b219bf51b 100644 --- a/src/GitHub.TeamFoundation.14/Services/VSGitServices.cs +++ b/src/GitHub.TeamFoundation.14/Services/VSGitServices.cs @@ -37,7 +37,7 @@ public class VSGitServices : IVSGitServices [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2017")] readonly Lazy statusBar; [SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2015")] - readonly Lazy vsServices; + readonly Lazy teamExplorerServices; /// /// This MEF export requires specific versions of TeamFoundation. IGitExt is declared here so @@ -50,11 +50,11 @@ public class VSGitServices : IVSGitServices [ImportingConstructor] public VSGitServices(IGitHubServiceProvider serviceProvider, Lazy statusBar, - Lazy vsServices) + Lazy 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 @@ -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(); var typedProgress = ((Progress)progress) ?? new Progress(); @@ -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(