You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: src/GitHub.Exports/Services/GitService.cs
+90-11Lines changed: 90 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -7,52 +7,93 @@
7
7
8
8
namespaceGitHub.Services
9
9
{
10
-
[Export(typeof(IVSServices))]
11
-
[PartCreationPolicy(CreationPolicy.Shared)]
10
+
[Export(typeof(IGitService))]
11
+
[PartCreationPolicy(CreationPolicy.NonShared)]
12
12
publicclassGitService:IGitService
13
13
{
14
14
/// <summary>
15
15
/// Returns the URL of the remote named "origin" for the specified <see cref="repository"/>. If the repository
16
16
/// is null or no remote named origin exists, this method returns null
17
17
/// </summary>
18
18
/// <param name="repository">The repository to look at for the remote.</param>
19
-
/// <returns>A <see cref="UriString"/> representing the origin or null if none found.</returns>
19
+
/// <returns>Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.</returns>
/// Probes for a git repository and if one is found, returns a <see cref="UriString"/> for the repository's
27
-
/// remote named "origin" if one is found
26
+
/// Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.
27
+
/// </summary>
28
+
/// <param name="repository"></param>
29
+
/// <returns>Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.</returns>
/// Probes for a git repository and if one is found, returns a normalized GitHub uri <see cref="UriString"/>
37
+
/// for the repository's remote named "origin" if one is found
28
38
/// </summary>
29
39
/// <remarks>
30
40
/// The lookup checks to see if the specified <paramref name="path"/> is a repository. If it's not, it then
31
41
/// walks up the parent directories until it either finds a repository, or reaches the root disk.
32
42
/// </remarks>
33
43
/// <param name="path">The path to start probing</param>
34
-
/// <returns>A <see cref="UriString"/> representing the origin or null if none found.</returns>
44
+
/// <returns>Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.</returns>
35
45
publicUriStringGetUri(stringpath)
36
46
{
37
47
returnGetUri(GetRepo(path));
38
48
}
39
49
40
50
/// <summary>
41
-
/// Probes for a git repository and if one is found, returns a <see cref="UriString"/> for the repository's
42
-
/// remote named "origin" if one is found
51
+
/// Probes for a git repository and if one is found, returns a normalized GitHub uri <see cref="UriString"/>
52
+
/// for the repository's remote named "origin" if one is found
53
+
/// </summary>
54
+
/// <remarks>
55
+
/// The lookup checks to see if the specified <paramref name="path"/> is a repository. If it's not, it then
56
+
/// walks up the parent directories until it either finds a repository, or reaches the root disk.
57
+
/// </remarks>
58
+
/// <param name="path">The path to start probing</param>
59
+
/// <returns>Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.</returns>
60
+
publicstaticUriStringGetUriFromPath(stringpath)
61
+
{
62
+
returnGitServiceHelper.GetUri(path);
63
+
}
64
+
65
+
/// <summary>
66
+
/// Probes for a git repository and if one is found, returns a normalized GitHub uri
67
+
/// <see cref="UriString"/> for the repository's remote named "origin" if one is found
43
68
/// </summary>
44
69
/// <remarks>
45
70
/// The lookup checks to see if the path specified by the RepositoryPath property of the specified
46
71
/// <see cref="repoInfo"/> is a repository. If it's not, it then walks up the parent directories until it
47
72
/// either finds a repository, or reaches the root disk.
48
73
/// </remarks>
49
74
/// <param name="repoInfo">The repository information containing the path to start probing</param>
50
-
/// <returns>A <see cref="UriString"/> representing the origin or null if none found.</returns>
75
+
/// <returns>Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.</returns>
51
76
publicUriStringGetUri(IGitRepositoryInforepoInfo)
52
77
{
53
78
returnGetUri(GetRepo(repoInfo));
54
79
}
55
80
81
+
/// <summary>
82
+
/// Probes for a git repository and if one is found, returns a normalized GitHub uri
83
+
/// <see cref="UriString"/> for the repository's remote named "origin" if one is found
84
+
/// </summary>
85
+
/// <remarks>
86
+
/// The lookup checks to see if the path specified by the RepositoryPath property of the specified
87
+
/// <see cref="repoInfo"/> is a repository. If it's not, it then walks up the parent directories until it
88
+
/// either finds a repository, or reaches the root disk.
89
+
/// </remarks>
90
+
/// <param name="repoInfo">The repository information containing the path to start probing</param>
91
+
/// <returns>Returns a <see cref="UriString"/> representing the uri of the "origin" remote normalized to a GitHub repository url or null if none found.</returns>
0 commit comments