This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathIRepositoryCloneService.cs
More file actions
72 lines (66 loc) · 2.96 KB
/
IRepositoryCloneService.cs
File metadata and controls
72 lines (66 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using System.Threading;
using System.Threading.Tasks;
using GitHub.Models;
using GitHub.Primitives;
namespace GitHub.Services
{
/// <summary>
/// Service used to clone GitHub repositories.
/// </summary>
public interface IRepositoryCloneService
{
/// <summary>
/// Default path to clone things to, used as fallback if we can't find the correct path
/// from VS.
/// </summary>
string DefaultClonePath { get; }
/// <summary>
/// Clones the specificed repository into the specified directory.
/// </summary>
/// <param name="cloneUrl">The url of the repository to clone.</param>
/// <param name="repositoryPath">The directory that will contain the repository directory.</param>
/// <param name="progress">
/// An object through which to report progress. This must be of type
/// System.IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData>, but
/// as that type is only available in VS2017+ it is typed as <see cref="object"/> here.
/// </param>
/// <param name="cancellationToken">A cancellation token.</param>
/// <returns></returns>
Task CloneRepository(
string cloneUrl,
string repositoryPath,
object progress = null,
CancellationToken? cancellationToken = null);
/// <summary>
/// Clones the specified repository into the specified directory or opens it if the directory already exists.
/// </summary>
/// <param name="cloneDialogResult">The URL and path of the repository to clone or open.</param>
/// <param name="progress">
/// An object through which to report progress. This must be of type
/// System.IProgress<Microsoft.VisualStudio.Shell.ServiceProgressData>, but
/// as that type is only available in VS2017+ it is typed as <see cref="object"/> here.
/// </param>
/// <returns></returns>
Task CloneOrOpenRepository(
CloneDialogResult cloneDialogResult,
object progress = null,
CancellationToken? cancellationToken = null);
/// <summary>
/// Checks whether the specified destination directory already exists.
/// </summary>
/// <param name="path">The destination path.</param>
/// <returns>
/// true if a directory is already present at <paramref name="path"/>; otherwise false.
/// </returns>
bool DestinationDirectoryExists(string path);
/// <summary>
/// Checks whether the specified destination file already exists.
/// </summary>
/// <param name="path">The destination file.</param>
/// <returns>
/// true if a file is already present at <paramref name="path"/>; otherwise false.
/// </returns>
bool DestinationFileExists(string path);
Task<ViewerRepositoriesModel> ReadViewerRepositories(HostAddress address);
}
}