@@ -69,6 +69,60 @@ IEnumerator IEnumerable.GetEnumerator()
69
69
70
70
#endregion
71
71
72
+ /// <summary>
73
+ /// Creates an annotated tag with the specified name.
74
+ /// </summary>
75
+ /// <param name="name">The name.</param>
76
+ /// <param name="objectish">Revparse spec for the target object.</param>
77
+ /// <param name="tagger">The tagger.</param>
78
+ /// <param name="message">The message.</param>
79
+ public virtual Tag Add ( string name , string objectish , Signature tagger , string message )
80
+ {
81
+ return Add ( name , objectish , tagger , message , false ) ;
82
+ }
83
+
84
+ /// <summary>
85
+ /// Creates an annotated tag with the specified name.
86
+ /// </summary>
87
+ /// <param name="name">The name.</param>
88
+ /// <param name="objectish">Revparse spec for the target object.</param>
89
+ /// <param name="tagger">The tagger.</param>
90
+ /// <param name="message">The message.</param>
91
+ /// <param name="allowOverwrite">True to allow silent overwriting a potentially existing tag, false otherwise.</param>
92
+ public virtual Tag Add ( string name , string objectish , Signature tagger , string message , bool allowOverwrite )
93
+ {
94
+ Ensure . ArgumentNotNullOrEmptyString ( objectish , "target" ) ;
95
+
96
+ GitObject objectToTag = repo . Lookup ( objectish , GitObjectType . Any , LookUpOptions . ThrowWhenNoGitObjectHasBeenFound ) ;
97
+
98
+ return Add ( name , objectToTag , tagger , message , allowOverwrite ) ;
99
+ }
100
+
101
+ /// <summary>
102
+ /// Creates a lightweight tag with the specified name.
103
+ /// </summary>
104
+ /// <param name="name">The name.</param>
105
+ /// <param name="objectish">Revparse spec for the target object.</param>
106
+ public virtual Tag Add ( string name , string objectish )
107
+ {
108
+ return Add ( name , objectish , false ) ;
109
+ }
110
+
111
+ /// <summary>
112
+ /// Creates a lightweight tag with the specified name.
113
+ /// </summary>
114
+ /// <param name="name">The name.</param>
115
+ /// <param name="objectish">Revparse spec for the target object.</param>
116
+ /// <param name="allowOverwrite">True to allow silent overwriting a potentially existing tag, false otherwise.</param>
117
+ public virtual Tag Add ( string name , string objectish , bool allowOverwrite )
118
+ {
119
+ Ensure . ArgumentNotNullOrEmptyString ( objectish , "objectish" ) ;
120
+
121
+ GitObject objectToTag = repo . Lookup ( objectish , GitObjectType . Any , LookUpOptions . ThrowWhenNoGitObjectHasBeenFound ) ;
122
+
123
+ return Add ( name , objectToTag , allowOverwrite ) ;
124
+ }
125
+
72
126
/// <summary>
73
127
/// Creates an annotated tag with the specified name.
74
128
/// </summary>
@@ -133,6 +187,17 @@ public virtual Tag Add(string name, GitObject target, bool allowOverwrite)
133
187
return this [ name ] ;
134
188
}
135
189
190
+ /// <summary>
191
+ /// Deletes the tag with the specified name.
192
+ /// </summary>
193
+ /// <param name="name">The short or canonical name of the tag to delete.</param>
194
+ public virtual void Remove ( string name )
195
+ {
196
+ Ensure . ArgumentNotNullOrEmptyString ( name , "name" ) ;
197
+
198
+ Proxy . git_tag_delete ( repo . Handle , UnCanonicalizeName ( name ) ) ;
199
+ }
200
+
136
201
/// <summary>
137
202
/// Deletes the tag with the specified name.
138
203
/// </summary>
@@ -141,7 +206,7 @@ public virtual void Remove(Tag tag)
141
206
{
142
207
Ensure . ArgumentNotNull ( tag , "tag" ) ;
143
208
144
- this . Remove ( tag . CanonicalName ) ;
209
+ Remove ( tag . CanonicalName ) ;
145
210
}
146
211
147
212
private static string NormalizeToCanonicalName ( string name )
@@ -156,7 +221,7 @@ private static string NormalizeToCanonicalName(string name)
156
221
return string . Concat ( Reference . TagPrefix , name ) ;
157
222
}
158
223
159
- internal static string UnCanonicalizeName ( string name )
224
+ private static string UnCanonicalizeName ( string name )
160
225
{
161
226
Ensure . ArgumentNotNullOrEmptyString ( name , "name" ) ;
162
227
0 commit comments