@@ -66,6 +66,18 @@ IEnumerator IEnumerable.GetEnumerator()
66
66
67
67
#endregion
68
68
69
+ /// <summary>
70
+ /// Creates a direct reference with the specified name and target
71
+ /// </summary>
72
+ /// <param name="name">The canonical name of the reference to create.</param>
73
+ /// <param name="targetId">Id of the target object.</param>
74
+ /// <param name="logMessage">The optional message to log in the <see cref="ReflogCollection"/> when adding the <see cref="DirectReference"/></param>
75
+ /// <returns>A new <see cref="Reference"/>.</returns>
76
+ public virtual DirectReference Add ( string name , ObjectId targetId , string logMessage )
77
+ {
78
+ return Add ( name , targetId , logMessage , false ) ;
79
+ }
80
+
69
81
/// <summary>
70
82
/// Creates a direct reference with the specified name and target
71
83
/// </summary>
@@ -74,7 +86,7 @@ IEnumerator IEnumerable.GetEnumerator()
74
86
/// <param name="logMessage">The optional message to log in the <see cref="ReflogCollection"/> when adding the <see cref="DirectReference"/></param>
75
87
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing reference, false otherwise.</param>
76
88
/// <returns>A new <see cref="Reference"/>.</returns>
77
- public virtual DirectReference Add ( string name , ObjectId targetId , string logMessage , bool allowOverwrite = false )
89
+ public virtual DirectReference Add ( string name , ObjectId targetId , string logMessage , bool allowOverwrite )
78
90
{
79
91
Ensure . ArgumentNotNullOrEmptyString ( name , "name" ) ;
80
92
Ensure . ArgumentNotNull ( targetId , "targetId" ) ;
@@ -85,18 +97,41 @@ public virtual DirectReference Add(string name, ObjectId targetId, string logMes
85
97
}
86
98
}
87
99
100
+ /// <summary>
101
+ /// Creates a direct reference with the specified name and target
102
+ /// </summary>
103
+ /// <param name="name">The canonical name of the reference to create.</param>
104
+ /// <param name="targetId">Id of the target object.</param>
105
+ /// <returns>A new <see cref="Reference"/>.</returns>
106
+ public virtual DirectReference Add ( string name , ObjectId targetId )
107
+ {
108
+ return Add ( name , targetId , null , false ) ;
109
+ }
110
+
88
111
/// <summary>
89
112
/// Creates a direct reference with the specified name and target
90
113
/// </summary>
91
114
/// <param name="name">The canonical name of the reference to create.</param>
92
115
/// <param name="targetId">Id of the target object.</param>
93
116
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing reference, false otherwise.</param>
94
117
/// <returns>A new <see cref="Reference"/>.</returns>
95
- public virtual DirectReference Add ( string name , ObjectId targetId , bool allowOverwrite = false )
118
+ public virtual DirectReference Add ( string name , ObjectId targetId , bool allowOverwrite )
96
119
{
97
120
return Add ( name , targetId , null , allowOverwrite ) ;
98
121
}
99
122
123
+ /// <summary>
124
+ /// Creates a symbolic reference with the specified name and target
125
+ /// </summary>
126
+ /// <param name="name">The canonical name of the reference to create.</param>
127
+ /// <param name="targetRef">The target reference.</param>
128
+ /// <param name="logMessage">The optional message to log in the <see cref="ReflogCollection"/> when adding the <see cref="SymbolicReference"/></param>
129
+ /// <returns>A new <see cref="Reference"/>.</returns>
130
+ public virtual SymbolicReference Add ( string name , Reference targetRef , string logMessage )
131
+ {
132
+ return Add ( name , targetRef , logMessage , false ) ;
133
+ }
134
+
100
135
/// <summary>
101
136
/// Creates a symbolic reference with the specified name and target
102
137
/// </summary>
@@ -105,7 +140,7 @@ public virtual DirectReference Add(string name, ObjectId targetId, bool allowOve
105
140
/// <param name="logMessage">The optional message to log in the <see cref="ReflogCollection"/> when adding the <see cref="SymbolicReference"/></param>
106
141
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing reference, false otherwise.</param>
107
142
/// <returns>A new <see cref="Reference"/>.</returns>
108
- public virtual SymbolicReference Add ( string name , Reference targetRef , string logMessage , bool allowOverwrite = false )
143
+ public virtual SymbolicReference Add ( string name , Reference targetRef , string logMessage , bool allowOverwrite )
109
144
{
110
145
Ensure . ArgumentNotNullOrEmptyString ( name , "name" ) ;
111
146
Ensure . ArgumentNotNull ( targetRef , "targetRef" ) ;
@@ -117,14 +152,25 @@ public virtual SymbolicReference Add(string name, Reference targetRef, string lo
117
152
}
118
153
}
119
154
155
+ /// <summary>
156
+ /// Creates a symbolic reference with the specified name and target
157
+ /// </summary>
158
+ /// <param name="name">The canonical name of the reference to create.</param>
159
+ /// <param name="targetRef">The target reference.</param>
160
+ /// <returns>A new <see cref="Reference"/>.</returns>
161
+ public virtual SymbolicReference Add ( string name , Reference targetRef )
162
+ {
163
+ return Add ( name , targetRef , null , false ) ;
164
+ }
165
+
120
166
/// <summary>
121
167
/// Creates a symbolic reference with the specified name and target
122
168
/// </summary>
123
169
/// <param name="name">The canonical name of the reference to create.</param>
124
170
/// <param name="targetRef">The target reference.</param>
125
171
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing reference, false otherwise.</param>
126
172
/// <returns>A new <see cref="Reference"/>.</returns>
127
- public virtual SymbolicReference Add ( string name , Reference targetRef , bool allowOverwrite = false )
173
+ public virtual SymbolicReference Add ( string name , Reference targetRef , bool allowOverwrite )
128
174
{
129
175
return Add ( name , targetRef , null , allowOverwrite ) ;
130
176
}
@@ -140,6 +186,18 @@ public virtual void Remove(Reference reference)
140
186
Proxy . git_reference_remove ( repo . Handle , reference . CanonicalName ) ;
141
187
}
142
188
189
+ /// <summary>
190
+ /// Rename an existing reference with a new name, and update the reflog
191
+ /// </summary>
192
+ /// <param name="reference">The reference to rename.</param>
193
+ /// <param name="newName">The new canonical name.</param>
194
+ /// <param name="logMessage">Message added to the reflog.</param>
195
+ /// <returns>A new <see cref="Reference"/>.</returns>
196
+ public virtual Reference Rename ( Reference reference , string newName , string logMessage )
197
+ {
198
+ return Rename ( reference , newName , logMessage , false ) ;
199
+ }
200
+
143
201
/// <summary>
144
202
/// Rename an existing reference with a new name, and update the reflog
145
203
/// </summary>
@@ -148,7 +206,7 @@ public virtual void Remove(Reference reference)
148
206
/// <param name="logMessage">Message added to the reflog.</param>
149
207
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing reference, false otherwise.</param>
150
208
/// <returns>A new <see cref="Reference"/>.</returns>
151
- public virtual Reference Rename ( Reference reference , string newName , string logMessage = null , bool allowOverwrite = false )
209
+ public virtual Reference Rename ( Reference reference , string newName , string logMessage , bool allowOverwrite )
152
210
{
153
211
Ensure . ArgumentNotNull ( reference , "reference" ) ;
154
212
Ensure . ArgumentNotNullOrEmptyString ( newName , "newName" ) ;
@@ -166,14 +224,25 @@ public virtual Reference Rename(Reference reference, string newName, string logM
166
224
}
167
225
}
168
226
227
+ /// <summary>
228
+ /// Rename an existing reference with a new name
229
+ /// </summary>
230
+ /// <param name="reference">The reference to rename.</param>
231
+ /// <param name="newName">The new canonical name.</param>
232
+ /// <returns>A new <see cref="Reference"/>.</returns>
233
+ public virtual Reference Rename ( Reference reference , string newName )
234
+ {
235
+ return Rename ( reference , newName , null , false ) ;
236
+ }
237
+
169
238
/// <summary>
170
239
/// Rename an existing reference with a new name
171
240
/// </summary>
172
241
/// <param name="reference">The reference to rename.</param>
173
242
/// <param name="newName">The new canonical name.</param>
174
243
/// <param name="allowOverwrite">True to allow silent overwriting a potentially existing reference, false otherwise.</param>
175
244
/// <returns>A new <see cref="Reference"/>.</returns>
176
- public virtual Reference Rename ( Reference reference , string newName , bool allowOverwrite = false )
245
+ public virtual Reference Rename ( Reference reference , string newName , bool allowOverwrite )
177
246
{
178
247
return Rename ( reference , newName , null , allowOverwrite ) ;
179
248
}
0 commit comments