Add unified diff view to version control tab

This commit is contained in:
Nick O'Leary
2017-10-09 00:11:07 +01:00
parent 51bad3bf3c
commit 10567afbb9
6 changed files with 185 additions and 14 deletions

View File

@@ -209,5 +209,15 @@ module.exports = {
commit: function(cwd, message) {
var args = ["commit","-m",message];
return runCommand(gitCommand,args,cwd);
},
getFileDiff(cwd,file,type) {
var args = ["diff"];
if (type === "tree") {
// nothing else to do
} else if (type === "index") {
args.push("--cached");
}
args.push(file);
return runCommand(gitCommand,args,cwd);
}
}