Adds compare with branch command

Adds branches quick pick
This commit is contained in:
Eric Amodio
2017-03-18 02:01:25 -04:00
parent 164cb2bfe0
commit 73bbbc1d5f
10 changed files with 149 additions and 5 deletions

View File

@@ -209,4 +209,32 @@ const statusOcticonsMap = {
};
export function getGitStatusIcon(status: GitFileStatus, missing: string = '\u00a0\u00a0\u00a0\u00a0'): string {
return statusOcticonsMap[status] || missing;
}
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;
}
}