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

Commit 991cac7

Browse files
authored
Merge pull request #2004 from github/fixes/2003-change-repository-when-clone-completes
Explicitly open repository when clone completes
2 parents 9e37f36 + 1c73776 commit 991cac7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class VSGitServices : IVSGitServices
3737
[SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2017")]
3838
readonly Lazy<IStatusBarNotificationService> statusBar;
3939
[SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Justification = "Used in VS2015")]
40-
readonly Lazy<IVSServices> vsServices;
40+
readonly Lazy<ITeamExplorerServices> teamExplorerServices;
4141

4242
/// <summary>
4343
/// This MEF export requires specific versions of TeamFoundation. IGitExt is declared here so
@@ -50,11 +50,11 @@ public class VSGitServices : IVSGitServices
5050
[ImportingConstructor]
5151
public VSGitServices(IGitHubServiceProvider serviceProvider,
5252
Lazy<IStatusBarNotificationService> statusBar,
53-
Lazy<IVSServices> vsServices)
53+
Lazy<ITeamExplorerServices> teamExplorerServices)
5454
{
5555
this.serviceProvider = serviceProvider;
5656
this.statusBar = statusBar;
57-
this.vsServices = vsServices;
57+
this.teamExplorerServices = teamExplorerServices;
5858
}
5959

6060
// The Default Repository Path that VS uses is hidden in an internal
@@ -90,7 +90,6 @@ public async Task Clone(
9090
await StartClonenOnConnectPageAsync(teamExplorer, cloneUrl, clonePath, recurseSubmodules);
9191
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
9292
await WaitForCloneOnHomePageAsync(teamExplorer);
93-
vsServices.Value.TryOpenRepository(clonePath); // Show the repository on Team Explorer - Home
9493
#else
9594
var gitExt = serviceProvider.GetService<IGitActionsExt>();
9695
var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>();
@@ -100,6 +99,8 @@ public async Task Clone(
10099
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
101100
await cloneTask;
102101
#endif
102+
// Change Team Explorer context to the newly cloned repository
103+
teamExplorerServices.Value.OpenRepository(clonePath);
103104
}
104105

105106
static async Task StartClonenOnConnectPageAsync(

0 commit comments

Comments
 (0)