mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-29 09:35:41 -05:00
Removes branches remote commands if no remotes
Removes branch remote commands if not tracked
This commit is contained in:
@@ -27,7 +27,7 @@ export class BranchHistoryNode extends ExplorerNode {
|
||||
name += ` ${GlyphChars.Space}${GlyphChars.ArrowLeftRight}${GlyphChars.Space} ${this.branch.tracking}`;
|
||||
}
|
||||
const item = new TreeItem(`${this.branch!.current ? `${GlyphChars.Check} ${GlyphChars.Space}` : ''}${name}`, TreeItemCollapsibleState.Collapsed);
|
||||
item.contextValue = this.resourceType;
|
||||
item.contextValue = this.branch.tracking ? `${this.resourceType}:remote` : this.resourceType;
|
||||
|
||||
item.iconPath = {
|
||||
dark: this.context.asAbsolutePath('images/dark/icon-branch.svg'),
|
||||
|
||||
@@ -21,9 +21,13 @@ export class BranchesNode extends ExplorerNode {
|
||||
return [...Iterables.filterMap(branches, b => b.remote ? undefined : new BranchHistoryNode(b, this.uri, this.git.config.gitExplorer.commitFormat, this.context, this.git))];
|
||||
}
|
||||
|
||||
getTreeItem(): TreeItem {
|
||||
async getTreeItem(): Promise<TreeItem> {
|
||||
const item = new TreeItem(`Branches`, TreeItemCollapsibleState.Expanded);
|
||||
item.contextValue = this.resourceType;
|
||||
|
||||
const remotes = await this.git.getRemotes(this.uri.repoPath!);
|
||||
item.contextValue = (remotes !== undefined && remotes.length > 0)
|
||||
? `${this.resourceType}:remote`
|
||||
: this.resourceType;
|
||||
|
||||
item.iconPath = {
|
||||
dark: this.context.asAbsolutePath('images/dark/icon-branch.svg'),
|
||||
|
||||
Reference in New Issue
Block a user