mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-17 09:45:36 -05:00
Adds compare with branch command
Adds branches quick pick
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user