Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Forster <brendan@github.com>2015-05-10 13:56:45 +0300
committernulltoken <emeric.fermas@gmail.com>2015-05-15 20:31:42 +0300
commit631b36c995813aa90d790d8f40e342681f443112 (patch)
treecefe8945448271273da484ece5a6d728e3047f3a
parentbce3f4c1320ebd5b72a40d8bc4ce7954ab8d37ee (diff)
Drop optional parameters in NetworkExtensions.cs
-rw-r--r--LibGit2Sharp/NetworkExtensions.cs29
1 files changed, 27 insertions, 2 deletions
diff --git a/LibGit2Sharp/NetworkExtensions.cs b/LibGit2Sharp/NetworkExtensions.cs
index cf769c95..4efc53f0 100644
--- a/LibGit2Sharp/NetworkExtensions.cs
+++ b/LibGit2Sharp/NetworkExtensions.cs
@@ -14,12 +14,24 @@ namespace LibGit2Sharp
/// </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>
+ /// <param name="network">The <see cref="Network"/> being worked with.</param>
+ /// <param name="branch">The branch to push.</param>
/// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior</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,
- PushOptions pushOptions = null)
+ PushOptions pushOptions)
{
network.Push(new[] { branch }, pushOptions);
}
@@ -29,12 +41,25 @@ namespace LibGit2Sharp
/// </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>
+ /// <param name="network">The <see cref="Network"/> being worked with.</param>
+ /// <param name="branches">The branches to push.</param>
/// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior</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,
- PushOptions pushOptions = null)
+ PushOptions pushOptions)
{
var enumeratedBranches = branches as IList<Branch> ?? branches.ToList();