Skip to content

Commit 024ab9c

Browse files
shiftkeynulltoken
authored andcommitted
Drop optional parameters in NetworkExtensions.cs
1 parent 3572946 commit 024ab9c

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

LibGit2Sharp/NetworkExtensions.cs

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ namespace LibGit2Sharp
99
/// </summary>
1010
public static class NetworkExtensions
1111
{
12+
/// <summary>
13+
/// Push the specified branch to its tracked branch on the remote.
14+
/// </summary>
15+
/// <param name="network">The <see cref="Network"/> being worked with.</param>
16+
/// <param name="branch">The branch to push.</param>
17+
/// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
18+
public static void Push(
19+
this Network network,
20+
Branch branch)
21+
{
22+
network.Push(new[] { branch });
23+
}
1224
/// <summary>
1325
/// Push the specified branch to its tracked branch on the remote.
1426
/// </summary>
@@ -19,11 +31,25 @@ public static class NetworkExtensions
1931
public static void Push(
2032
this Network network,
2133
Branch branch,
22-
PushOptions pushOptions = null)
34+
PushOptions pushOptions)
2335
{
2436
network.Push(new[] { branch }, pushOptions);
2537
}
2638

39+
/// <summary>
40+
/// Push the specified branches to their tracked branches on the remote.
41+
/// </summary>
42+
/// <param name="network">The <see cref="Network"/> being worked with.</param>
43+
/// <param name="branches">The branches to push.</param>
44+
/// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior</param>
45+
/// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
46+
public static void Push(
47+
this Network network,
48+
IEnumerable<Branch> branches)
49+
{
50+
network.Push(branches, null);
51+
}
52+
2753
/// <summary>
2854
/// Push the specified branches to their tracked branches on the remote.
2955
/// </summary>
@@ -34,7 +60,7 @@ public static void Push(
3460
public static void Push(
3561
this Network network,
3662
IEnumerable<Branch> branches,
37-
PushOptions pushOptions = null)
63+
PushOptions pushOptions)
3864
{
3965
var enumeratedBranches = branches as IList<Branch> ?? branches.ToList();
4066

0 commit comments

Comments
 (0)