Skip to content

Commit

Permalink
Replace tag delete
Browse files Browse the repository at this point in the history
  • Loading branch information
ylecuyer authored and wmertens committed Apr 27, 2020
1 parent 3a93b5f commit 75b810e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/git-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,13 @@ exports.registerApi = (env) => {
});

app.delete(`${exports.pathPrefix}/tags`, ensureAuthenticated, ensurePathExists, (req, res) => {
jsonResultOrFailProm(
res,
gitPromise(['tag', '-d', req.query.name.trim()], req.query.path)
).finally(emitGitDirectoryChanged.bind(null, req.query.path));
let pathToRepo = req.query.path;
let tagName = req.query.name.trim();
nodegit.Repository.open(pathToRepo).then(function (repo) {
jsonResultOrFailProm(res, nodegit.Tag.delete(repo, tagName)).finally(
emitGitDirectoryChanged.bind(null, req.query.path)
);
});
});

app.delete(
Expand Down

0 comments on commit 75b810e

Please sign in to comment.