Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Drop unused GIT commit API
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
  • Loading branch information
Bruno Bottazzini committed Apr 22, 2016
1 parent a65f9d5 commit 6da847d
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions server/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,54 +343,6 @@
}
});

router.post('/api/git/repo/commit', function (req, res) {
var commit_message = req.body.params.commit_message;
var branch = req.body.params.branch;
var user = req.body.params.user;
var pass = req.body.params.password;
var repo = req.body.params.repo;
var repo_owner = req.body.params.repo_owner;
var github = require('octonode');
var path = require('path');
var _p = home_dir(current_user(req));
var git_dir = _p + "/" + repo_owner + "/" + repo;
var client = github.client({
username: user,
password: pass
});
client.get('/user', function (err, status, body) {
if (typeof status === 'undefined') {
res.status(400).send("Verify login or password");
} else {
if (typeof status === 'undefined') {
res.status(404).send("Error: File not found on github");
} else {
execOnServer('git --git-dir=' + git_dir + '/.git add .', function(returns) {
if (returns.error === true) {
res.status(400).send("Failed to run command on server");
} else {
execOnServer('git --git-dir=' + git_dir + '/.git commit -m "' + commit_message + '"' , function(returns) {
if (returns.error === true) {
res.status(400).send("Failed to run command on server");
} else {
execOnServer('git --git-dir=' + git_dir + '/.git push https://' + user +
':' + pass + '@github.com/' + repo_owner + '/' + repo +
'.git', function(returns) {
if (returns.error === true) {
res.status(400).send("Failed to run command on server");
} else {
res.sendStatus(0);
}
});
}
});
}
});
}
}
});
});

router.post('/api/git/repo/create/project', function (req, res) {
var project_name = req.body.params.project_name;
if (!project_name) {
Expand Down

0 comments on commit 6da847d

Please sign in to comment.