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

Commit 4ce6852

Browse files
committed
TryOpenRepository on empty target folder
If the user navigates away from the Connect page, the CanClone property will stop updating and the Clone method won't return. Point Team Explorer at the target folder when clone starts incase this happens.
1 parent 43b504e commit 4ce6852

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,15 @@ public async Task Clone(
8989
var gitExt = await GetGitRepositoriesExtAsync(teamExplorer);
9090
gitExt.Clone(cloneUrl, clonePath, recurseSubmodules ? CloneOptions.RecurseSubmodule : CloneOptions.None);
9191

92+
// First open the target folder in case the user navigates away from the Connect page.
93+
vsServices.Value.TryOpenRepository(clonePath);
94+
9295
// The operation will have completed when CanClone goes false and then true again.
93-
// It looks like the CanClone property is only live as long as the Connect page is visible.
9496
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => !x).Take(1); // Wait until started
9597
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => x).Take(1); // Wait until completed
9698

97-
// Show progress on Team Explorer - Home
99+
// Navigate when clone completes, otherwise we'll stop receiving updates to CanClone property.
98100
NavigateToHomePage(teamExplorer);
99-
100-
// Open cloned repository in Team Explorer
101-
vsServices.Value.TryOpenRepository(clonePath);
102101
#else
103102
var gitExt = serviceProvider.GetService<IGitActionsExt>();
104103
var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>();

0 commit comments

Comments
 (0)