diff --git a/js/controlbox.js b/js/controlbox.js index c9761bf..922edd7 100644 --- a/js/controlbox.js +++ b/js/controlbox.js @@ -506,6 +506,12 @@ function(_yargs, d3, demos) { while (args.length > 0) { var arg = args.shift(); + + if(arg.trim() === '-d' || arg.trim() === '--delete'){ + var tagName = args.shift(); + this.getRepoView().deleteTag(tagName); + return this; + } try { this.getRepoView().tag(arg); diff --git a/js/historyview.js b/js/historyview.js index 7687ac1..c50612a 100644 --- a/js/historyview.js +++ b/js/historyview.js @@ -1228,6 +1228,16 @@ define(['d3'], function() { this.branch('[' + name + ']'); }, + deleteTag: function(name) { + this.branches = this.branches.filter(branch => branch !== `[${name.trim()}]`); + + this.commitData.forEach(commit => { + commit.tags = commit.tags.filter(tag => tag !== `[${name.trim()}]`) + }); + + this.renderTags(); + }, + deleteBranch: function(name) { var branchIndex, commit;