@@ -17,15 +17,15 @@ public static class NetworkExtensions
17
17
/// <param name="network">The <see cref="Network"/> being worked with.</param>
18
18
/// <param name="branch">The branch to push.</param>
19
19
/// <param name="onPushStatusError">Handler for reporting failed push updates.</param>
20
- /// <param name="credentials">Credentials to use for user/pass authentication. </param>
20
+ /// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior </param>
21
21
/// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
22
22
public static void Push (
23
23
this Network network ,
24
24
Branch branch ,
25
25
PushStatusErrorHandler onPushStatusError = null ,
26
- Credentials credentials = null )
26
+ PushOptions pushOptions = null )
27
27
{
28
- network . Push ( new [ ] { branch } , onPushStatusError , credentials ) ;
28
+ network . Push ( new [ ] { branch } , onPushStatusError , pushOptions ) ;
29
29
}
30
30
31
31
/// <summary>
@@ -34,13 +34,13 @@ public static void Push(
34
34
/// <param name="network">The <see cref="Network"/> being worked with.</param>
35
35
/// <param name="branches">The branches to push.</param>
36
36
/// <param name="onPushStatusError">Handler for reporting failed push updates.</param>
37
- /// <param name="credentials">Credentials to use for user/pass authentication. </param>
37
+ /// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior </param>
38
38
/// <exception cref="LibGit2SharpException">Throws if either the Remote or the UpstreamBranchCanonicalName is not set.</exception>
39
39
public static void Push (
40
40
this Network network ,
41
41
IEnumerable < Branch > branches ,
42
42
PushStatusErrorHandler onPushStatusError = null ,
43
- Credentials credentials = null )
43
+ PushOptions pushOptions = null )
44
44
{
45
45
var enumeratedBranches = branches as IList < Branch > ?? branches . ToList ( ) ;
46
46
@@ -55,7 +55,7 @@ public static void Push(
55
55
56
56
foreach ( var branch in enumeratedBranches )
57
57
{
58
- network . Push ( branch . Remote , string . Format ( "{0}:{1}" , branch . CanonicalName , branch . UpstreamBranchCanonicalName ) , onPushStatusError , credentials ) ;
58
+ network . Push ( branch . Remote , string . Format ( "{0}:{1}" , branch . CanonicalName , branch . UpstreamBranchCanonicalName ) , onPushStatusError , pushOptions ) ;
59
59
}
60
60
}
61
61
@@ -66,21 +66,21 @@ public static void Push(
66
66
/// <param name="remote">The <see cref="Remote"/> to push to.</param>
67
67
/// <param name="objectish">The source objectish to push.</param>
68
68
/// <param name="destinationSpec">The reference to update on the remote.</param>
69
- /// <param name="credentials">Credentials to use for user/pass authentication </param>
69
+ /// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior </param>
70
70
/// <returns>Results of the push operation.</returns>
71
71
public static PushResult Push (
72
72
this Network network ,
73
73
Remote remote ,
74
74
string objectish ,
75
75
string destinationSpec ,
76
- Credentials credentials = null )
76
+ PushOptions pushOptions = null )
77
77
{
78
78
Ensure . ArgumentNotNull ( remote , "remote" ) ;
79
79
Ensure . ArgumentNotNull ( objectish , "objectish" ) ;
80
80
Ensure . ArgumentNotNullOrEmptyString ( destinationSpec , "destinationSpec" ) ;
81
81
82
82
return network . Push ( remote , string . Format ( CultureInfo . InvariantCulture ,
83
- "{0}:{1}" , objectish , destinationSpec ) , credentials ) ;
83
+ "{0}:{1}" , objectish , destinationSpec ) , pushOptions ) ;
84
84
}
85
85
86
86
/// <summary>
@@ -89,14 +89,18 @@ public static PushResult Push(
89
89
/// <param name="network">The <see cref="Network"/> being worked with.</param>
90
90
/// <param name="remote">The <see cref="Remote"/> to push to.</param>
91
91
/// <param name="pushRefSpec">The pushRefSpec to push.</param>
92
- /// <param name="credentials">Credentials to use for user/pass authentication </param>
92
+ /// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior </param>
93
93
/// <returns>Results of the push operation.</returns>
94
- public static PushResult Push ( this Network network , Remote remote , string pushRefSpec , Credentials credentials = null )
94
+ public static PushResult Push (
95
+ this Network network ,
96
+ Remote remote ,
97
+ string pushRefSpec ,
98
+ PushOptions pushOptions = null )
95
99
{
96
100
Ensure . ArgumentNotNull ( remote , "remote" ) ;
97
101
Ensure . ArgumentNotNullOrEmptyString ( pushRefSpec , "pushRefSpec" ) ;
98
102
99
- return network . Push ( remote , new [ ] { pushRefSpec } , credentials ) ;
103
+ return network . Push ( remote , new string [ ] { pushRefSpec } , pushOptions ) ;
100
104
}
101
105
102
106
/// <summary>
@@ -105,9 +109,13 @@ public static PushResult Push(this Network network, Remote remote, string pushRe
105
109
/// <param name="network">The <see cref="Network"/> being worked with.</param>
106
110
/// <param name="remote">The <see cref="Remote"/> to push to.</param>
107
111
/// <param name="pushRefSpecs">The pushRefSpecs to push.</param>
108
- /// <param name="credentials">Credentials to use for user/pass authentication </param>
112
+ /// <param name="pushOptions"><see cref="PushOptions"/> controlling push behavior </param>
109
113
/// <returns>Results of the push operation.</returns>
110
- public static PushResult Push ( this Network network , Remote remote , IEnumerable < string > pushRefSpecs , Credentials credentials = null )
114
+ public static PushResult Push (
115
+ this Network network ,
116
+ Remote remote ,
117
+ IEnumerable < string > pushRefSpecs ,
118
+ PushOptions pushOptions = null )
111
119
{
112
120
Ensure . ArgumentNotNull ( remote , "remote" ) ;
113
121
Ensure . ArgumentNotNull ( pushRefSpecs , "pushRefSpecs" ) ;
@@ -118,7 +126,7 @@ public static PushResult Push(this Network network, Remote remote, IEnumerable<s
118
126
remote ,
119
127
pushRefSpecs ,
120
128
failedRemoteUpdates . Add ,
121
- credentials ) ;
129
+ pushOptions ) ;
122
130
123
131
return new PushResult ( failedRemoteUpdates ) ;
124
132
}
0 commit comments