diff --git a/src/commands/quickCommand.steps.ts b/src/commands/quickCommand.steps.ts index dae944c..6803a3d 100644 --- a/src/commands/quickCommand.steps.ts +++ b/src/commands/quickCommand.steps.ts @@ -150,6 +150,7 @@ export async function getRemotes( (typeof options.picked === 'string' ? r.name === options.picked : options.picked.includes(r.name)), { buttons: options?.buttons, + upstream: true, }, ), ); diff --git a/src/git/models/remote.ts b/src/git/models/remote.ts index d3ae58e..c0f6443 100644 --- a/src/git/models/remote.ts +++ b/src/git/models/remote.ts @@ -1,5 +1,6 @@ import type { ColorTheme } from 'vscode'; import { Uri, window } from 'vscode'; +import { GlyphChars } from '../../constants'; import { Container } from '../../container'; import { sortCompare } from '../../system/string'; import { isLightTheme } from '../../system/utils'; @@ -92,6 +93,48 @@ export class GitRemote { } async getTreeItem(): Promise { - let arrows; - let left; - let right; - for (const { type } of this.remote.urls) { - if (type === GitRemoteType.Fetch) { - left = true; - - if (right) break; - } else if (type === GitRemoteType.Push) { - right = true; - - if (left) break; - } - } - - if (left && right) { - arrows = GlyphChars.ArrowsRightLeft; - } else if (right) { - arrows = GlyphChars.ArrowRight; - } else if (left) { - arrows = GlyphChars.ArrowLeft; - } else { - arrows = GlyphChars.Dash; - } - const item = new TreeItem(this.remote.name, TreeItemCollapsibleState.Collapsed); item.id = this.id; + item.description = getRemoteUpstreamDescription(this.remote); if (this.remote.provider != null) { const { provider } = this.remote; - item.description = `${arrows}${GlyphChars.Space} ${provider.name} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} ${provider.displayPath}`; item.iconPath = provider.avatarUri != null && this.view.config.avatars ? provider.avatarUri @@ -137,11 +112,6 @@ export class RemoteNode extends ViewNode { item.tooltip = `${this.remote.name} (${provider.name})\n${provider.displayPath}\n`; } } else { - item.description = `${arrows}${GlyphChars.Space} ${ - this.remote.domain - ? `${this.remote.domain} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} ` - : '' - }${this.remote.path}`; item.contextValue = ContextValues.Remote; item.iconPath = new ThemeIcon('cloud'); item.tooltip = `${this.remote.name} (${this.remote.domain})\n${this.remote.path}\n`;