mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 09:45:36 -05:00
Adds full git status parsing Adds git status info into status quick pick Switches to async/await in file blame/log
29 lines
591 B
TypeScript
29 lines
591 B
TypeScript
'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;
|
|
}
|
|
} |