Skip to content

Commit c6ef24d

Browse files
committed
Add XML comments
1 parent 747bfc6 commit c6ef24d

File tree

7 files changed

+109
-5
lines changed

7 files changed

+109
-5
lines changed

LibGit2Sharp/FetchOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public sealed class FetchOptions : FetchOptionsBase
2828

2929
/// <summary>
3030
/// Get/Set the custom headers.
31-
///
32-
/// <para>
33-
/// This allows you to set custom headers (e.g. X-Forwarded-For,
31+
///
32+
/// <para>
33+
/// This allows you to set custom headers (e.g. X-Forwarded-For,
3434
/// X-Request-Id, etc),
3535
/// </para>
3636
/// </summary>
3737
/// <remarks>
38-
/// Libgit2 sets some headers for HTTP requests (User-Agent, Host,
38+
/// Libgit2 sets some headers for HTTP requests (User-Agent, Host,
3939
/// Accept, Content-Type, Transfer-Encoding, Content-Length, Accept) that
4040
/// cannot be overriden.
4141
/// </remarks>

LibGit2Sharp/FetchOptionsBase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal FetchOptionsBase()
3535

3636
/// <summary>
3737
/// This handler will be called to let the user make a decision on whether to allow
38-
/// the connection to preoceed based on the certificate presented by the server.
38+
/// the connection to proceed based on the certificate presented by the server.
3939
/// </summary>
4040
public CertificateCheckHandler CertificateCheck { get; set; }
4141

@@ -49,6 +49,9 @@ internal FetchOptionsBase()
4949
/// </summary>
5050
public RepositoryOperationCompleted RepositoryOperationCompleted { get; set; }
5151

52+
/// <summary>
53+
/// Options for connecting through a proxy.
54+
/// </summary>
5255
public ProxyOptions ProxyOptions { get; } = new();
5356
}
5457
}

LibGit2Sharp/Network.cs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ public virtual IEnumerable<Reference> ListReferences(Remote remote)
5555
return ListReferencesInternal(remote.Url, null, new ProxyOptions());
5656
}
5757

58+
/// <summary>
59+
/// List references in a <see cref="Remote"/> repository.
60+
/// <para>
61+
/// When the remote tips are ahead of the local ones, the retrieved
62+
/// <see cref="DirectReference"/>s may point to non existing
63+
/// <see cref="GitObject"/>s in the local repository. In that
64+
/// case, <see cref="DirectReference.Target"/> will return <c>null</c>.
65+
/// </para>
66+
/// </summary>
67+
/// <param name="remote">The <see cref="Remote"/> to list from.</param>
68+
/// <param name="proxyOptions">Options for connecting through a proxy.</param>
69+
/// <returns>The references in the <see cref="Remote"/> repository.</returns>
5870
public virtual IEnumerable<Reference> ListReferences(Remote remote, ProxyOptions proxyOptions)
5971
{
6072
Ensure.ArgumentNotNull(remote, "remote");
@@ -82,6 +94,19 @@ public virtual IEnumerable<Reference> ListReferences(Remote remote, CredentialsH
8294
return ListReferencesInternal(remote.Url, credentialsProvider, new ProxyOptions());
8395
}
8496

97+
/// <summary>
98+
/// List references in a <see cref="Remote"/> repository.
99+
/// <para>
100+
/// When the remote tips are ahead of the local ones, the retrieved
101+
/// <see cref="DirectReference"/>s may point to non existing
102+
/// <see cref="GitObject"/>s in the local repository. In that
103+
/// case, <see cref="DirectReference.Target"/> will return <c>null</c>.
104+
/// </para>
105+
/// </summary>
106+
/// <param name="remote">The <see cref="Remote"/> to list from.</param>
107+
/// <param name="credentialsProvider">The <see cref="Func{Credentials}"/> used to connect to remote repository.</param>
108+
/// <param name="proxyOptions">Options for connecting through a proxy.</param>
109+
/// <returns>The references in the <see cref="Remote"/> repository.</returns>
85110
public virtual IEnumerable<Reference> ListReferences(Remote remote, CredentialsHandler credentialsProvider, ProxyOptions proxyOptions)
86111
{
87112
Ensure.ArgumentNotNull(remote, "remote");
@@ -108,6 +133,18 @@ public virtual IEnumerable<Reference> ListReferences(string url)
108133
return ListReferencesInternal(url, null, new ProxyOptions());
109134
}
110135

136+
/// <summary>
137+
/// List references in a remote repository.
138+
/// <para>
139+
/// When the remote tips are ahead of the local ones, the retrieved
140+
/// <see cref="DirectReference"/>s may point to non existing
141+
/// <see cref="GitObject"/>s in the local repository. In that
142+
/// case, <see cref="DirectReference.Target"/> will return <c>null</c>.
143+
/// </para>
144+
/// </summary>
145+
/// <param name="url">The url to list from.</param>
146+
/// <param name="proxyOptions">Options for connecting through a proxy.</param>
147+
/// <returns>The references in the remote repository.</returns>
111148
public virtual IEnumerable<Reference> ListReferences(string url, ProxyOptions proxyOptions)
112149
{
113150
Ensure.ArgumentNotNull(url, "url");
@@ -135,6 +172,19 @@ public virtual IEnumerable<Reference> ListReferences(string url, CredentialsHand
135172
return ListReferencesInternal(url, credentialsProvider, new ProxyOptions());
136173
}
137174

175+
/// <summary>
176+
/// List references in a remote repository.
177+
/// <para>
178+
/// When the remote tips are ahead of the local ones, the retrieved
179+
/// <see cref="DirectReference"/>s may point to non existing
180+
/// <see cref="GitObject"/>s in the local repository. In that
181+
/// case, <see cref="DirectReference.Target"/> will return <c>null</c>.
182+
/// </para>
183+
/// </summary>
184+
/// <param name="url">The url to list from.</param>
185+
/// <param name="credentialsProvider">The <see cref="Func{Credentials}"/> used to connect to remote repository.</param>
186+
/// <param name="proxyOptions">Options for connecting through a proxy.</param>
187+
/// <returns>The references in the remote repository.</returns>
138188
public virtual IEnumerable<Reference> ListReferences(string url, CredentialsHandler credentialsProvider, ProxyOptions proxyOptions)
139189
{
140190
Ensure.ArgumentNotNull(url, "url");

LibGit2Sharp/ProxyOptions.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,30 @@
44

55
namespace LibGit2Sharp
66
{
7+
/// <summary>
8+
/// Options for connecting through a proxy.
9+
/// </summary>
710
public sealed class ProxyOptions
811
{
12+
/// <summary>
13+
/// The type of proxy to use. Set to Auto by default.
14+
/// </summary>
915
public ProxyType ProxyType { get; set; } = ProxyType.Auto;
1016

17+
/// <summary>
18+
/// The URL of the proxy when <see cref="LibGit2Sharp.ProxyType"/> is set to Specified.
19+
/// </summary>
1120
public string Url { get; set; }
1221

22+
/// <summary>
23+
/// Handler to generate <see cref="LibGit2Sharp.Credentials"/> for authentication.
24+
/// </summary>
1325
public CredentialsHandler CredentialsProvider { get; set; }
1426

27+
/// <summary>
28+
/// This handler will be called to let the user make a decision on whether to allow
29+
/// the connection to proceed based on the certificate presented by the server.
30+
/// </summary>
1531
public CertificateCheckHandler CertificateCheck { get; set; }
1632

1733
internal unsafe GitProxyOptions CreateGitProxyOptions()

LibGit2Sharp/ProxyType.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
namespace LibGit2Sharp
22
{
3+
/// <summary>
4+
/// The type of proxy to use.
5+
/// </summary>
36
public enum ProxyType
47
{
8+
/// <summary>
9+
/// Do not attempt to connect through a proxy.
10+
/// </summary>
511
None,
12+
13+
/// <summary>
14+
/// Try to auto-detect the proxy from the git configuration.
15+
/// </summary>
616
Auto,
17+
18+
/// <summary>
19+
/// Connect via the URL given in the options.
20+
/// </summary>
721
Specified
822
}
923
}

LibGit2Sharp/PushOptions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public sealed class PushOptions
7272
/// <value>The custom headers string array</value>
7373
public string[] CustomHeaders { get; set; }
7474

75+
/// <summary>
76+
/// Options for connecting through a proxy.
77+
/// </summary>
7578
public ProxyOptions ProxyOptions { get; set; } = new();
7679
}
7780
}

LibGit2Sharp/Repository.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,12 @@ public static IEnumerable<Reference> ListRemoteReferences(string url)
659659
return ListRemoteReferences(url, null, new ProxyOptions());
660660
}
661661

662+
/// <summary>
663+
/// Lists the Remote Repository References.
664+
/// </summary>
665+
/// <param name="url">The url to list from.</param>
666+
/// <param name="proxyOptions">Options for connecting through a proxy.</param>
667+
/// <returns>The references in the remote repository.</returns>
662668
public static IEnumerable<Reference> ListRemoteReferences(string url, ProxyOptions proxyOptions)
663669
{
664670
return ListRemoteReferences(url, null, proxyOptions);
@@ -680,6 +686,18 @@ public static IEnumerable<Reference> ListRemoteReferences(string url, Credential
680686
return ListRemoteReferences(url, credentialsProvider, new ProxyOptions());
681687
}
682688

689+
/// <summary>
690+
/// Lists the Remote Repository References.
691+
/// </summary>
692+
/// <para>
693+
/// Does not require a local Repository. The retrieved
694+
/// <see cref="IBelongToARepository.Repository"/>
695+
/// throws <see cref="InvalidOperationException"/> in this case.
696+
/// </para>
697+
/// <param name="url">The url to list from.</param>
698+
/// <param name="credentialsProvider">The <see cref="Func{Credentials}"/> used to connect to remote repository.</param>
699+
/// <param name="proxyOptions">Options for connecting through a proxy.</param>
700+
/// <returns>The references in the remote repository.</returns>
683701
public static IEnumerable<Reference> ListRemoteReferences(string url, CredentialsHandler credentialsProvider, ProxyOptions proxyOptions)
684702
{
685703
Ensure.ArgumentNotNull(url, "url");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy