@@ -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,24 @@ 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+ /// <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+
2752 /// <summary>
2853 /// Push the specified branches to their tracked branches on the remote.
2954 /// </summary>
@@ -34,7 +59,7 @@ public static void Push(
3459 public static void Push (
3560 this Network network ,
3661 IEnumerable < Branch > branches ,
37- PushOptions pushOptions = null )
62+ PushOptions pushOptions )
3863 {
3964 var enumeratedBranches = branches as IList < Branch > ?? branches . ToList ( ) ;
4065
0 commit comments