diff --git a/src/git/models/reference.ts b/src/git/models/reference.ts index 24a9260..d4dc084 100644 --- a/src/git/models/reference.ts +++ b/src/git/models/reference.ts @@ -1,6 +1,6 @@ import { configuration } from '../../configuration'; import { GlyphChars } from '../../constants'; -import { getBranchNameWithoutRemote } from './branch'; +import { getBranchNameWithoutRemote, getRemoteNameFromBranchName } from './branch'; const rangeRegex = /^(\S*?)(\.\.\.?)(\S*)\s*$/; const shaLikeRegex = /(^[0-9a-f]{40}([\^@~:]\S*)?$)|(^[0]{40}(:|-)$)/; @@ -306,6 +306,11 @@ export namespace GitReference { let refName = options?.quoted ? `'${ref.name}'` : ref.name; switch (ref.refType) { case 'branch': + if (ref.remote) { + refName = `${getRemoteNameFromBranchName(refName)}: ${getBranchNameWithoutRemote(refName)}`; + refName = options?.quoted ? `'${refName}'` : refName; + } + result = `${options.label ? `${ref.remote ? 'remote ' : ''}branch ` : ''}${ options.icon ? `$(git-branch)${GlyphChars.Space}${refName}` : refName }`;