@@ -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,25 @@ 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
+ /// <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
+
27
53
/// <summary>
28
54
/// Push the specified branches to their tracked branches on the remote.
29
55
/// </summary>
@@ -34,7 +60,7 @@ public static void Push(
34
60
public static void Push (
35
61
this Network network ,
36
62
IEnumerable < Branch > branches ,
37
- PushOptions pushOptions = null )
63
+ PushOptions pushOptions )
38
64
{
39
65
var enumeratedBranches = branches as IList < Branch > ?? branches . ToList ( ) ;
40
66
0 commit comments