@@ -69,6 +69,60 @@ IEnumerator IEnumerable.GetEnumerator()
6969
7070 #endregion
7171
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+
72126 /// <summary>
73127 /// Creates an annotated tag with the specified name.
74128 /// </summary>
@@ -133,6 +187,17 @@ public virtual Tag Add(string name, GitObject target, bool allowOverwrite)
133187 return this [ name ] ;
134188 }
135189
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+
136201 /// <summary>
137202 /// Deletes the tag with the specified name.
138203 /// </summary>
@@ -141,7 +206,7 @@ public virtual void Remove(Tag tag)
141206 {
142207 Ensure . ArgumentNotNull ( tag , "tag" ) ;
143208
144- this . Remove ( tag . CanonicalName ) ;
209+ Remove ( tag . CanonicalName ) ;
145210 }
146211
147212 private static string NormalizeToCanonicalName ( string name )
@@ -156,7 +221,7 @@ private static string NormalizeToCanonicalName(string name)
156221 return string . Concat ( Reference . TagPrefix , name ) ;
157222 }
158223
159- internal static string UnCanonicalizeName ( string name )
224+ private static string UnCanonicalizeName ( string name )
160225 {
161226 Ensure . ArgumentNotNullOrEmptyString ( name , "name" ) ;
162227
0 commit comments