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

Commit a5a2b1a

Browse files
committed
Show clone progress on Team Explorer - Home
A clone progress bar and option to cancel appears on Team Explorer - Home while cloning. Navigate to Team Explorer - Home, when clone operation is about to start.
1 parent b1a0171 commit a5a2b1a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ public async Task CloneOrOpenRepository(
150150
await usageTracker.IncrementCounter(x => x.NumberOfEnterpriseClones);
151151
}
152152
}
153-
154-
teamExplorerServices.ShowHomePage();
155153
}
156154

157155
/// <inheritdoc/>

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,16 @@ public async Task Clone(
8686
gitExt.Clone(cloneUrl, clonePath, recurseSubmodules ? CloneOptions.RecurseSubmodule : CloneOptions.None);
8787

8888
// The operation will have completed when CanClone goes false and then true again.
89-
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => !x).Take(1);
90-
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => x).Take(1);
89+
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => !x).Take(1); // Wait until started
90+
NavigateToHomePage(teamExplorer); // Show progress on Team Explorer - Home
91+
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => x).Take(1); // Wait until completed
9192
#else
9293
var gitExt = serviceProvider.GetService<IGitActionsExt>();
9394
var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>();
9495

96+
// Show progress on Team Explorer - Home
97+
NavigateToHomePage(teamExplorer);
98+
9599
await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.RunAsync(async () =>
96100
{
97101
typedProgress.ProgressChanged += (s, e) => statusBar.Value.ShowMessage(e.ProgressText);
@@ -100,6 +104,11 @@ await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.RunAsync(asy
100104
#endif
101105
}
102106

107+
static void NavigateToHomePage(ITeamExplorer teamExplorer)
108+
{
109+
teamExplorer.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null);
110+
}
111+
103112
static async Task<IGitRepositoriesExt> GetGitRepositoriesExtAsync(ITeamExplorer teamExplorer)
104113
{
105114
var connectPage = await NavigateToPageAsync(teamExplorer, new Guid(TeamExplorerPageIds.Connect));

0 commit comments

Comments
 (0)