Skip to content

Commit

Permalink
replace remote create
Browse files Browse the repository at this point in the history
  • Loading branch information
ylecuyer authored and wmertens committed Apr 27, 2020
1 parent 75b810e commit 31277b1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/git-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,12 @@ exports.registerApi = (env) => {
ensureAuthenticated,
ensurePathExists,
(req, res) => {
jsonResultOrFailProm(
res,
gitPromise(['remote', 'add', req.params.name, req.body.url], req.body.path)
);
let name = req.params.name;
let url = req.body.url;
let pathToRepo = req.body.path;
nodegit.Repository.open(pathToRepo).then(function (repo) {
jsonResultOrFailProm(res, nodegit.Remote.create(repo, name, url));
});
}
);

Expand Down

0 comments on commit 31277b1

Please sign in to comment.