Git - use different icon for current branch + code cleanup (#274479)

This commit is contained in:
Ladislau Szomoru
2025-11-01 07:56:16 +00:00
committed by GitHub
parent 63553dfa36
commit 6c86512615
7 changed files with 47 additions and 27 deletions

View File

@@ -70,7 +70,10 @@ export class GitArtifactProvider implements SourceControlArtifactProvider, IDisp
return refs.map(r => ({
id: `refs/heads/${r.name}`,
name: r.name ?? r.commit ?? '',
description: getArtifactDescription(r, shortCommitLength)
description: getArtifactDescription(r, shortCommitLength),
icon: r.name === this.repository.HEAD?.name
? new ThemeIcon('target')
: new ThemeIcon('git-branch')
}));
} else if (group === 'tags') {
const refs = await this.repository
@@ -79,7 +82,8 @@ export class GitArtifactProvider implements SourceControlArtifactProvider, IDisp
return refs.map(r => ({
id: `refs/tags/${r.name}`,
name: r.name ?? r.commit ?? '',
description: getArtifactDescription(r, shortCommitLength)
description: getArtifactDescription(r, shortCommitLength),
icon: new ThemeIcon('tag')
}));
}
} catch (err) {