mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Added quickpick option and display of tag annotation on menu
This commit is contained in:
@@ -15,7 +15,7 @@ import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp,
|
||||
import { CancellationToken } from 'vscode';
|
||||
import { URI } from 'vscode-uri';
|
||||
import { detectEncoding } from './encoding';
|
||||
import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git';
|
||||
import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status, Tag } from './api/git';
|
||||
|
||||
// https://github.com/microsoft/vscode/issues/65693
|
||||
const MAX_CLI_LENGTH = 30000;
|
||||
@@ -1290,6 +1290,21 @@ export class Repository {
|
||||
await this.run(args);
|
||||
}
|
||||
|
||||
async getTags(): Promise<Tag[]> {
|
||||
let args = ['tag', '-n1'];
|
||||
const result = await this.run(args);
|
||||
return result.stdout.trim().split('\n')
|
||||
.map(line => line.trim().split('\0'))
|
||||
.map(([line]) => {
|
||||
const name = line.split(' ')[0];
|
||||
return {
|
||||
name: name,
|
||||
message: line.replace(name, '').trim() || '',
|
||||
type: RefType.Tag
|
||||
} as Tag;
|
||||
});
|
||||
}
|
||||
|
||||
async clean(paths: string[]): Promise<void> {
|
||||
const pathsByGroup = groupBy(paths, p => path.dirname(p));
|
||||
const groups = Object.keys(pathsByGroup).map(k => pathsByGroup[k]);
|
||||
|
||||
Reference in New Issue
Block a user