Skip to content

Commit f2ef49c

Browse files
mattyclarksonJohn Haley
authored andcommitted
repository.deleteTagByName API
A good convenience function for deleting a tag
1 parent cda88df commit f2ef49c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/repository.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,20 @@ Repository.prototype.getTagByName = function(name, callback) {
314314
}, callback);
315315
};
316316

317+
/**
318+
* Deletes a tag from a repository by the tag name.
319+
*
320+
* @async
321+
* @param {String} Short or full tag name
322+
*/
323+
Repository.prototype.deleteTagByName = function(name) {
324+
var repository = this;
325+
326+
name = ~name.indexOf("refs/tags/") ? name.substr(10) : name;
327+
328+
return Tag.delete(repository, name);
329+
};
330+
317331
/**
318332
* Instantiate a new revision walker for browsing the Repository"s history.
319333
* See also `Commit.prototype.history()`

0 commit comments

Comments
 (0)