Merge commit 'refs/pull/78695/head' of github.com:microsoft/vscode into pr/78695

This commit is contained in:
Joao Moreno
2019-08-13 09:46:54 +02:00
4 changed files with 24 additions and 4 deletions

View File

@@ -1624,8 +1624,15 @@ export class Repository {
.map(([ref]) => ({ name: ref, type: RefType.Head } as Branch));
}
async getRefs(): Promise<Ref[]> {
const result = await this.run(['for-each-ref', '--format', '%(refname) %(objectname)', '--sort', '-committerdate']);
async getRefs(sortBranchListByCommitterDate?: Boolean): Promise<Ref[]> {
const args = ['for-each-ref', '--format', '%(refname) %(objectname)'];
if (sortBranchListByCommitterDate) {
args.push('--sort');
args.push('-committerdate');
}
const result = await this.run(args);
const fn = (line: string): Ref | null => {
let match: RegExpExecArray | null;