File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -109,4 +109,39 @@ describe("Tag", function() {
109109 return Promise . resolve ( ) ;
110110 } ) ;
111111 } ) ;
112+
113+ it ( "can create a new lightweight tag in a repo and delete it" , function ( ) {
114+ var oid = Oid . fromString ( commitPointedTo ) ;
115+ var name = "created-lightweight-tag" ;
116+ var repository = this . repository ;
117+
118+ return repository . createLightweightTag ( oid , name )
119+ . then ( function ( reference ) {
120+ return reference . target ( ) ;
121+ } )
122+ . then ( function ( refOid ) {
123+ assert . equal ( refOid . toString ( ) , oid . toString ( ) ) ;
124+ } )
125+ . then ( function ( ) {
126+ return repository . createLightweightTag ( oid , name ) ;
127+ } )
128+ . then ( function ( ) {
129+ return Promise . reject ( new Error ( "should not be able to create the '" +
130+ name + "' tag twice" ) ) ;
131+ } , function ( ) {
132+ return Promise . resolve ( ) ;
133+ } )
134+ . then ( function ( ) {
135+ return repository . deleteTagByName ( name ) ;
136+ } )
137+ . then ( function ( ) {
138+ return Reference . lookup ( repository , "refs/tags/" + name ) ;
139+ } )
140+ . then ( function ( ) {
141+ return Promise . reject ( new Error ( "the tag '" + name +
142+ "' should not exist" ) ) ;
143+ } , function ( ) {
144+ return Promise . resolve ( ) ;
145+ } ) ;
146+ } ) ;
112147} ) ;
You can’t perform that action at this time.
0 commit comments