cleanup git delete tag command

This commit is contained in:
Joao Moreno
2019-10-24 15:27:57 +02:00
parent 23a4df3672
commit f402575486
6 changed files with 17 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp,
import { CancellationToken, Progress } from 'vscode';
import { URI } from 'vscode-uri';
import { detectEncoding } from './encoding';
import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status, Tag } from './api/git';
import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git';
import * as byline from 'byline';
import { StringDecoder } from 'string_decoder';
@@ -1332,21 +1332,6 @@ 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]);