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

Commit 49a55f1

Browse files
author
Meaghan Lewis
authored
Merge branch 'master' into readme/remove-mention-of-beta-versions
2 parents f6a004a + a49e5de commit 49a55f1

File tree

13 files changed

+32
-453
lines changed

13 files changed

+32
-453
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Visit the [documentation](https://github.com/github/VisualStudio/tree/master/doc
3131

3232
* Visual Studio 2017 (15.7.4)+
3333
* Visual Studio SDK
34+
* The built VSIX will work with Visual Studio 2015 or newer
3435

3536
## Build
3637

src/GitHub.App/SampleData/RepositoryRecloneViewModelDesigner.cs

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/GitHub.App/Services/DialogService.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,6 @@ public async Task<CloneDialogResult> ShowCloneDialog(IConnection connection, str
6969
}
7070
}
7171

72-
public async Task<string> ShowReCloneDialog(RepositoryModel repository)
73-
{
74-
Guard.ArgumentNotNull(repository, nameof(repository));
75-
76-
var viewModel = factory.CreateViewModel<IRepositoryRecloneViewModel>();
77-
viewModel.SelectedRepository = repository;
78-
return (string)await showDialog.ShowWithFirstConnection(viewModel);
79-
}
80-
8172
public async Task ShowCreateGist(IConnection connection)
8273
{
8374
var viewModel = factory.CreateViewModel<IGistCreationViewModel>();

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ public async Task<ViewerRepositoriesModel> ReadViewerRepositories(HostAddress ad
114114
/// <inheritdoc/>
115115
public async Task CloneOrOpenRepository(
116116
CloneDialogResult cloneDialogResult,
117-
object progress = null)
117+
object progress = null,
118+
CancellationToken? cancellationToken = null)
118119
{
119120
Guard.ArgumentNotNull(cloneDialogResult, nameof(cloneDialogResult));
120121

@@ -147,7 +148,7 @@ public async Task CloneOrOpenRepository(
147148
else
148149
{
149150
var cloneUrl = repositoryUrl.ToString();
150-
await CloneRepository(cloneUrl, repositoryPath, progress).ConfigureAwait(true);
151+
await CloneRepository(cloneUrl, repositoryPath, progress, cancellationToken).ConfigureAwait(true);
151152

152153
if (isDotCom)
153154
{
@@ -197,7 +198,8 @@ bool IsSolutionInRepository(string repositoryPath)
197198
public async Task CloneRepository(
198199
string cloneUrl,
199200
string repositoryPath,
200-
object progress = null)
201+
object progress = null,
202+
CancellationToken? cancellationToken = null)
201203
{
202204
Guard.ArgumentNotEmptyString(cloneUrl, nameof(cloneUrl));
203205
Guard.ArgumentNotEmptyString(repositoryPath, nameof(repositoryPath));
@@ -210,7 +212,7 @@ public async Task CloneRepository(
210212

211213
try
212214
{
213-
await vsGitServices.Clone(cloneUrl, repositoryPath, true, progress);
215+
await vsGitServices.Clone(cloneUrl, repositoryPath, true, progress, cancellationToken);
214216
await usageTracker.IncrementCounter(x => x.NumberOfClones);
215217

216218
if (repositoryPath.StartsWith(DefaultClonePath, StringComparison.OrdinalIgnoreCase))

src/GitHub.App/ViewModels/Dialog/RepositoryRecloneViewModel.cs

Lines changed: 0 additions & 162 deletions
This file was deleted.

src/GitHub.Exports.Reactive/Services/IRepositoryCloneService.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Threading;
32
using System.Threading.Tasks;
43
using GitHub.Models;
54
using GitHub.Primitives;
@@ -27,11 +26,13 @@ public interface IRepositoryCloneService
2726
/// System.IProgress&lt;Microsoft.VisualStudio.Shell.ServiceProgressData&gt;, but
2827
/// as that type is only available in VS2017+ it is typed as <see cref="object"/> here.
2928
/// </param>
29+
/// <param name="cancellationToken">A cancellation token.</param>
3030
/// <returns></returns>
3131
Task CloneRepository(
3232
string cloneUrl,
3333
string repositoryPath,
34-
object progress = null);
34+
object progress = null,
35+
CancellationToken? cancellationToken = null);
3536

3637
/// <summary>
3738
/// Clones the specified repository into the specified directory or opens it if the directory already exists.
@@ -45,7 +46,8 @@ Task CloneRepository(
4546
/// <returns></returns>
4647
Task CloneOrOpenRepository(
4748
CloneDialogResult cloneDialogResult,
48-
object progress = null);
49+
object progress = null,
50+
CancellationToken? cancellationToken = null);
4951

5052
/// <summary>
5153
/// Checks whether the specified destination directory already exists.

src/GitHub.Exports.Reactive/ViewModels/Dialog/IRepositoryRecloneViewModel.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/GitHub.Exports/Services/IDialogService.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,6 @@ public interface IDialogService
2525
/// </returns>
2626
Task<CloneDialogResult> ShowCloneDialog(IConnection connection, string url = null);
2727

28-
/// <summary>
29-
/// Shows the re-clone dialog.
30-
/// </summary>
31-
/// <param name="repository">The repository to clone.</param>
32-
/// <returns>
33-
/// A task that returns the base path for the clone on success, or null if the dialog was
34-
/// cancelled.
35-
/// </returns>
36-
/// <remarks>
37-
/// The re-clone dialog is shown from the VS2017+ start page when the user wants to check
38-
/// out a repository that was previously checked out on another machine.
39-
/// </remarks>
40-
Task<string> ShowReCloneDialog(RepositoryModel repository);
41-
4228
/// <summary>
4329
/// Shows the Create Gist dialog.
4430
/// </summary>

src/GitHub.Exports/Services/IVSGitServices.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Threading;
34
using System.Threading.Tasks;
45
using GitHub.Models;
56

@@ -20,13 +21,15 @@ public interface IVSGitServices
2021
/// System.IProgress&lt;Microsoft.VisualStudio.Shell.ServiceProgressData&gt;, but
2122
/// as that type is only available in VS2017+ it is typed as <see cref="object"/> here.
2223
/// </param>
24+
/// <param name="cancellationToken">A cancellation token.</param>
2325
/// <seealso cref="System.IProgress{T}"/>
2426
/// <seealso cref="Microsoft.VisualStudio.Shell.ServiceProgressData"/>
2527
Task Clone(
2628
string cloneUrl,
2729
string clonePath,
2830
bool recurseSubmodules,
29-
object progress = null);
31+
object progress = null,
32+
CancellationToken? cancellationToken = null);
3033

3134
string GetActiveRepoPath();
3235
LibGit2Sharp.IRepository GetActiveRepo();

0 commit comments

Comments
 (0)