SCM - more improvements to the repositories view (#274438)

* SCM - tweak artifact folder compression

* SCM - fixed more commands and layout

* SCM - more compression changes
This commit is contained in:
Ladislau Szomoru
2025-10-31 21:49:50 +00:00
committed by GitHub
parent ff488e306c
commit edf5868b02
4 changed files with 118 additions and 54 deletions

View File

@@ -3363,24 +3363,7 @@ export class CommandCenter {
@command('git.createTag', { repository: true })
async createTag(repository: Repository, historyItem?: SourceControlHistoryItem): Promise<void> {
const inputTagName = await window.showInputBox({
placeHolder: l10n.t('Tag name'),
prompt: l10n.t('Please provide a tag name'),
ignoreFocusOut: true
});
if (!inputTagName) {
return;
}
const inputMessage = await window.showInputBox({
placeHolder: l10n.t('Message'),
prompt: l10n.t('Please provide a message to annotate the tag'),
ignoreFocusOut: true
});
const name = inputTagName.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-');
await repository.tag({ name, message: inputMessage, ref: historyItem?.id });
await this._createTag(repository, historyItem?.id);
}
@command('git.deleteTag', { repository: true })
@@ -5259,6 +5242,24 @@ export class CommandCenter {
config.update(setting, !enabled, true);
}
@command('git.repositories.createBranch', { repository: true })
async artifactGroupCreateBranch(repository: Repository): Promise<void> {
if (!repository) {
return;
}
await this._branch(repository, undefined, false);
}
@command('git.repositories.createTag', { repository: true })
async artifactGroupCreateTag(repository: Repository): Promise<void> {
if (!repository) {
return;
}
await this._createTag(repository);
}
@command('git.repositories.checkout', { repository: true })
async artifactCheckout(repository: Repository, artifact: SourceControlArtifact): Promise<void> {
if (!repository || !artifact) {
@@ -5312,6 +5313,27 @@ export class CommandCenter {
`${sourceRef.ref.name}${artifact.name}`);
}
private async _createTag(repository: Repository, ref?: string): Promise<void> {
const inputTagName = await window.showInputBox({
placeHolder: l10n.t('Tag name'),
prompt: l10n.t('Please provide a tag name'),
ignoreFocusOut: true
});
if (!inputTagName) {
return;
}
const inputMessage = await window.showInputBox({
placeHolder: l10n.t('Message'),
prompt: l10n.t('Please provide a message to annotate the tag'),
ignoreFocusOut: true
});
const name = inputTagName.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$/g, '-');
await repository.tag({ name, message: inputMessage, ref });
}
private createCommand(id: string, key: string, method: Function, options: ScmCommandOptions): (...args: any[]) => any {
const result = (...args: any[]) => {
let result: Promise<any>;