Skip to content

Commit 770fc01

Browse files
committed
move checkoutType out of git service
1 parent eeb3857 commit 770fc01

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/vs/workbench/parts/git/browser/gitQuickOpen.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import { localize } from 'vs/nls';
88
import { matchesContiguousSubString } from 'vs/base/common/filters';
99
import { TPromise } from 'vs/base/common/winjs.base';
1010
import Severity from 'vs/base/common/severity';
11-
import { IGitService, RefType, IRef } from 'vs/workbench/parts/git/common/git';
11+
import { IGitService, RefType, IRef, IGitConfiguration } from 'vs/workbench/parts/git/common/git';
1212
import { ICommand, CommandQuickOpenHandler } from 'vs/workbench/browser/quickopen';
1313
import { Mode } from 'vs/base/parts/quickopen/common/quickOpen';
1414
import { QuickOpenEntry, IHighlight, IContext, QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel';
1515
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
1616
import { IMessageService } from 'vs/platform/message/common/message';
17+
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
1718

1819
class AbstractRefEntry extends QuickOpenEntry {
1920

@@ -130,14 +131,15 @@ class CheckoutCommand implements ICommand {
130131
aliases = ['checkout', 'co'];
131132
icon = 'git';
132133

133-
constructor(private gitService: IGitService, private messageService: IMessageService) {
134+
constructor(private gitService: IGitService, private messageService: IMessageService, private configurationService: IConfigurationService) {
134135
// noop
135136
}
136137

137138
getResults(input: string): TPromise<QuickOpenEntry[]> {
138139
input = input.trim();
139140

140-
const checkoutType = this.gitService.checkoutType;
141+
const config = this.configurationService.getConfiguration<IGitConfiguration>('git');
142+
const checkoutType = config.checkoutType;
141143
const includeTags = checkoutType === 'all' || checkoutType === 'tags';
142144
const includeRemotes = checkoutType === 'all' || checkoutType === 'remote';
143145

@@ -252,11 +254,16 @@ class BranchCommand implements ICommand {
252254

253255
export class GitCommandQuickOpenHandler extends CommandQuickOpenHandler {
254256

255-
constructor( @IQuickOpenService quickOpenService: IQuickOpenService, @IGitService gitService: IGitService, @IMessageService messageService: IMessageService) {
257+
constructor(
258+
@IQuickOpenService quickOpenService: IQuickOpenService,
259+
@IGitService gitService: IGitService,
260+
@IMessageService messageService: IMessageService,
261+
@IConfigurationService configurationService: IConfigurationService
262+
) {
256263
super(quickOpenService, {
257264
prefix: 'git',
258265
commands: [
259-
new CheckoutCommand(gitService, messageService),
266+
new CheckoutCommand(gitService, messageService, configurationService),
260267
new BranchCommand(gitService, messageService)
261268
]
262269
});

src/vs/workbench/parts/git/browser/gitServices.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,6 @@ export class GitService extends EventEmitter
418418
this.transition(ServiceState.OK);
419419
}
420420
}
421-
get checkoutType(): string {
422-
const { checkoutType } = this.configurationService.getConfiguration<IGitConfiguration>('git');
423-
return checkoutType;
424-
}
425421

426422
get onOutput(): Event<string> { return this.raw.onOutput; }
427423

src/vs/workbench/parts/git/common/git.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ export const IGitService = createDecorator<IGitService>(GIT_SERVICE_ID);
306306
export interface IGitService extends IEventEmitter {
307307
_serviceBrand: any;
308308
allowHugeRepositories: boolean;
309-
checkoutType: string;
310309
onOutput: Event<string>;
311310
status(): TPromise<IModel>;
312311
init(): TPromise<IModel>;

0 commit comments

Comments
 (0)