Przeglądaj źródła

Formats remote branch name for better readability

main
Eric Amodio 1 rok temu
rodzic
commit
d0f7ce2f56
1 zmienionych plików z 6 dodań i 1 usunięć
  1. +6
    -1
      src/git/models/reference.ts

+ 6
- 1
src/git/models/reference.ts Wyświetl plik

@ -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
}`;

Ładowanie…
Anuluj
Zapisz