@@ -9,6 +9,18 @@ namespace LibGit2Sharp
9
9
/// </summary>
10
10
public static class NetworkExtensions
11
11
{
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
+ }
12
24
/// <summary>
13
25
/// Push the specified branch to its tracked branch on the remote.
14
26
/// </summary>
@@ -19,11 +31,24 @@ public static class NetworkExtensions
19
31
public static void Push (
20
32
this Network network ,
21
33
Branch branch ,
22
- PushOptions pushOptions = null )
34
+ PushOptions pushOptions )
23
35
{
24
36
network . Push ( new [ ] { branch } , pushOptions ) ;
25
37
}
26
38
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
+ /// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
45
+ public static void Push (
46
+ this Network network ,
47
+ IEnumerable < Branch > branches )
48
+ {
49
+ network . Push ( branches , null ) ;
50
+ }
51
+
27
52
/// <summary>
28
53
/// Push the specified branches to their tracked branches on the remote.
29
54
/// </summary>
@@ -34,7 +59,7 @@ public static void Push(
34
59
public static void Push (
35
60
this Network network ,
36
61
IEnumerable < Branch > branches ,
37
- PushOptions pushOptions = null )
62
+ PushOptions pushOptions )
38
63
{
39
64
var enumeratedBranches = branches as IList < Branch > ?? branches . ToList ( ) ;
40
65
0 commit comments