Skip to content

Commit

Permalink
Drop optional parameters in NetworkExtensions.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey authored and nulltoken committed May 15, 2015
1 parent bce3f4c commit 631b36c
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions LibGit2Sharp/NetworkExtensions.cs
Expand Up @@ -9,6 +9,18 @@ namespace LibGit2Sharp
/// </summary>
public static class NetworkExtensions
{
/// <summary>
/// Push the specified branch to its tracked branch on the remote.
/// </summary>
/// <param name="network">The <see cref="Network"/> being worked with.</param>
/// <param name="branch">The branch to push.</param>
/// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
public static void Push(
this Network network,
Branch branch)
{
network.Push(new[] { branch });
}
/// <summary>
/// Push the specified branch to its tracked branch on the remote.
/// </summary>
Expand All @@ -19,11 +31,24 @@ public static class NetworkExtensions
public static void Push(
this Network network,
Branch branch,
PushOptions pushOptions = null)
PushOptions pushOptions)
{
network.Push(new[] { branch }, pushOptions);
}

/// <summary>
/// Push the specified branches to their tracked branches on the remote.
/// </summary>
/// <param name="network">The <see cref="Network"/> being worked with.</param>
/// <param name="branches">The branches to push.</param>
/// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
public static void Push(
this Network network,
IEnumerable<Branch> branches)
{
network.Push(branches, null);
}

/// <summary>
/// Push the specified branches to their tracked branches on the remote.
/// </summary>
Expand All @@ -34,7 +59,7 @@ public static class NetworkExtensions
public static void Push(
this Network network,
IEnumerable<Branch> branches,
PushOptions pushOptions = null)
PushOptions pushOptions)
{
var enumeratedBranches = branches as IList<Branch> ?? branches.ToList();

Expand Down

0 comments on commit 631b36c

Please sign in to comment.