mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
💄
This commit is contained in:
parent
2c878484c8
commit
22a3f3ec83
|
@ -1355,14 +1355,14 @@
|
|||
"default": false,
|
||||
"description": "%config.supportCancellation%"
|
||||
},
|
||||
"git.sortOrderForBranch": {
|
||||
"git.branchSortOrder": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"committerdate",
|
||||
"alphabetically"
|
||||
],
|
||||
"default": "committerdate",
|
||||
"description": "%config.sortOrderForBranch%"
|
||||
"description": "%config.branchSortOrder%"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
"config.confirmForcePush": "Controls whether to ask for confirmation before force-pushing.",
|
||||
"config.openDiffOnClick": "Controls whether the diff editor should be opened when clicking a change. Otherwise the regular editor will be opened.",
|
||||
"config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.",
|
||||
"config.sortOrderForBranch": "Controls the sort order for branches",
|
||||
"config.branchSortOrder": "Controls the sort order for branches.",
|
||||
"colors.added": "Color for added resources.",
|
||||
"colors.modified": "Color for modified resources.",
|
||||
"colors.deleted": "Color for deleted resources.",
|
||||
|
|
|
@ -1624,12 +1624,11 @@ export class Repository {
|
|||
.map(([ref]) => ({ name: ref, type: RefType.Head } as Branch));
|
||||
}
|
||||
|
||||
async getRefs(sortBranchListByCommitterDate?: Boolean): Promise<Ref[]> {
|
||||
async getRefs(opts?: { sort?: 'alphabetically' | 'committerdate' }): Promise<Ref[]> {
|
||||
const args = ['for-each-ref', '--format', '%(refname) %(objectname)'];
|
||||
|
||||
if (sortBranchListByCommitterDate) {
|
||||
args.push('--sort');
|
||||
args.push('-committerdate');
|
||||
if (opts && opts.sort && opts.sort !== 'alphabetically') {
|
||||
args.push('--sort', opts.sort);
|
||||
}
|
||||
|
||||
const result = await this.run(args);
|
||||
|
|
|
@ -701,7 +701,7 @@ export class Repository implements Disposable {
|
|||
onConfigListener(updateIndexGroupVisibility, this, this.disposables);
|
||||
updateIndexGroupVisibility();
|
||||
|
||||
const onConfigListenerForBranchSortOrder = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.sortOrderForBranch', root));
|
||||
const onConfigListenerForBranchSortOrder = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.branchSortOrder', root));
|
||||
onConfigListenerForBranchSortOrder(this.updateModelState, this, this.disposables);
|
||||
|
||||
this.mergeGroup.hideWhenEmpty = true;
|
||||
|
@ -1408,7 +1408,6 @@ export class Repository implements Disposable {
|
|||
const config = workspace.getConfiguration('git');
|
||||
const shouldIgnore = config.get<boolean>('ignoreLimitWarning') === true;
|
||||
const useIcons = !config.get<boolean>('decorations.enabled', true);
|
||||
const sortBranchListByCommitterDate = config.get<string>('sortOrderForBranch') === 'committerdate';
|
||||
this.isRepositoryHuge = didHitLimit;
|
||||
|
||||
if (didHitLimit && !shouldIgnore && !this.didWarnAboutLimit) {
|
||||
|
@ -1458,7 +1457,8 @@ export class Repository implements Disposable {
|
|||
// noop
|
||||
}
|
||||
|
||||
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs(sortBranchListByCommitterDate), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
|
||||
const sort = config.get<'alphabetically' | 'committerdate'>('branchSortOrder') || 'alphabetically';
|
||||
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs({ sort }), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
|
||||
|
||||
this._HEAD = HEAD;
|
||||
this._refs = refs;
|
||||
|
|
Loading…
Reference in a new issue