Refactors git models & parsers

Adds full git status parsing
Adds git status info into status quick pick
Switches to async/await in file blame/log
This commit is contained in:
Eric Amodio
2017-03-19 00:36:51 -04:00
parent 14eebbba15
commit ef74ae0950
19 changed files with 556 additions and 407 deletions

29
src/git/models/branch.ts Normal file
View File

@@ -0,0 +1,29 @@
'use strict';
export class GitBranch {
current: boolean;
name: string;
remote: boolean;
constructor(branch: string) {
branch = branch.trim();
if (branch.startsWith('* ')) {
branch = branch.substring(2);
this.current = true;
}
if (branch.startsWith('remotes/')) {
branch = branch.substring(8);
this.remote = true;
}
const index = branch.indexOf(' ');
if (index !== -1) {
branch = branch.substring(0, index);
}
this.name = branch;
}
}