Allow unstaged files to be reverted

This commit is contained in:
Nick O'Leary
2017-12-11 17:05:12 +00:00
parent 604e3068b2
commit bb59cd5742
8 changed files with 180 additions and 81 deletions

View File

@@ -173,7 +173,7 @@ function getFileDiff(user, project,file,type) {
}
function getCommits(user, project,options) {
checkActiveProject(project);
return activeProject.getCommits(options);
return activeProject.getCommits(options);
}
function getCommit(user, project,sha) {
checkActiveProject(project);
@@ -184,6 +184,12 @@ function getFile(user, project,filePath,sha) {
checkActiveProject(project);
return activeProject.getFile(filePath,sha);
}
function revertFile(user, project,filePath) {
checkActiveProject(project);
return activeProject.revertFile(filePath).then(function() {
return reloadActiveProject("revert");
})
}
function push(user, project,remoteBranchName,setRemote) {
checkActiveProject(project);
return activeProject.push(user,remoteBranchName,setRemote);
@@ -413,6 +419,7 @@ module.exports = {
updateProject: updateProject,
getFiles: getFiles,
getFile: getFile,
revertFile: revertFile,
stageFile: stageFile,
unstageFile: unstageFile,
commit: commit,