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

Commit f4f3ddd

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 50b6102 commit f4f3ddd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,19 @@ public async Task Clone(
8585
var gitExt = await GetGitRepositoriesExtAsync(teamExplorer);
8686
gitExt.Clone(cloneUrl, clonePath, recurseSubmodules ? CloneOptions.RecurseSubmodule : CloneOptions.None);
8787

88+
// Show progress on Team Explorer - Home
89+
NavigateToHomePage(teamExplorer);
90+
8891
// The operation will have completed when CanClone goes false and then true again.
8992
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => !x).Take(1);
9093
await gitExt.WhenAnyValue(x => x.CanClone).Where(x => x).Take(1);
9194
#else
9295
var gitExt = serviceProvider.GetService<IGitActionsExt>();
9396
var typedProgress = ((Progress<ServiceProgressData>)progress) ?? new Progress<ServiceProgressData>();
9497

98+
// Show progress on Team Explorer - Home
99+
NavigateToHomePage(teamExplorer);
100+
95101
await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.RunAsync(async () =>
96102
{
97103
typedProgress.ProgressChanged += (s, e) => statusBar.Value.ShowMessage(e.ProgressText);
@@ -100,6 +106,11 @@ await Microsoft.VisualStudio.Shell.ThreadHelper.JoinableTaskFactory.RunAsync(asy
100106
#endif
101107
}
102108

109+
static void NavigateToHomePage(ITeamExplorer teamExplorer)
110+
{
111+
teamExplorer.NavigateToPage(new Guid(TeamExplorerPageIds.Home), null);
112+
}
113+
103114
static async Task<IGitRepositoriesExt> GetGitRepositoriesExtAsync(ITeamExplorer teamExplorer)
104115
{
105116
var connectPage = await NavigateToPageAsync(teamExplorer, new Guid(TeamExplorerPageIds.Connect));

0 commit comments

Comments
 (0)