mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 18:19:12 +01:00
Git - Remove git.branchProtectionIndicator setting (#153020)
Remove git.branchProtectionIndicator setting
This commit is contained in:
@@ -26,7 +26,7 @@ const localize = nls.loadMessageBundle();
|
||||
class CheckoutItem implements QuickPickItem {
|
||||
|
||||
protected get shortCommit(): string { return (this.ref.commit || '').substr(0, 8); }
|
||||
get label(): string { return this.ref.name ? `${this.ref.name}${this.repository.isBranchProtected(this.ref.name, 'quickOpen') ? ' $(lock-small)' : ''}` : this.shortCommit; }
|
||||
get label(): string { return this.ref.name ? `${this.ref.name}${this.repository.isBranchProtected(this.ref.name) ? ' $(lock-small)' : ''}` : this.shortCommit; }
|
||||
get description(): string { return this.shortCommit; }
|
||||
|
||||
constructor(protected repository: Repository, protected ref: Ref) { }
|
||||
|
||||
@@ -942,7 +942,6 @@ export class Repository implements Disposable {
|
||||
|
||||
filterEvent(workspace.onDidChangeConfiguration, e =>
|
||||
e.affectsConfiguration('git.branchProtection', root)
|
||||
|| e.affectsConfiguration('git.branchProtectionIndicator', root)
|
||||
|| e.affectsConfiguration('git.branchSortOrder', root)
|
||||
|| e.affectsConfiguration('git.untrackedChanges', root)
|
||||
|| e.affectsConfiguration('git.ignoreSubmodules', root)
|
||||
@@ -2230,17 +2229,7 @@ export class Repository implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
public isBranchProtected(name: string = this.HEAD?.name ?? '', indicator?: 'quickOpen' | 'statusBar'): boolean {
|
||||
if (indicator) {
|
||||
const scopedConfig = workspace.getConfiguration('git', Uri.file(this.repository.root));
|
||||
const branchProtectionIndicator = scopedConfig.get<{ quickOpen: boolean; statusBar: boolean }>('branchProtectionIndicator', { quickOpen: true, statusBar: true });
|
||||
|
||||
if ((indicator === 'quickOpen' && !branchProtectionIndicator.quickOpen) ||
|
||||
(indicator === 'statusBar' && !branchProtectionIndicator.statusBar)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public isBranchProtected(name: string = this.HEAD?.name ?? ''): boolean {
|
||||
return this.isBranchProtectedMatcher ? this.isBranchProtectedMatcher(name) : false;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class CheckoutStatusBar {
|
||||
|
||||
get command(): Command | undefined {
|
||||
const rebasing = !!this.repository.rebaseCommit;
|
||||
const isBranchProtected = this.repository.isBranchProtected(undefined, 'statusBar');
|
||||
const isBranchProtected = this.repository.isBranchProtected();
|
||||
const title = `${isBranchProtected ? '$(lock)' : '$(git-branch)'} ${this.repository.headLabel}${rebasing ? ` (${localize('rebasing', 'Rebasing')})` : ''}`;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user