git: enabled config

This commit is contained in:
Joao Moreno
2017-02-07 12:03:42 +01:00
parent e5a555bf36
commit 7c8d8e822f
4 changed files with 29 additions and 6 deletions

View File

@@ -21,9 +21,16 @@ import * as nls from 'vscode-nls';
const localize = nls.config()();
async function init(disposables: Disposable[]): Promise<void> {
const outputChannel = window.createOutputChannel('Git');
disposables.push(outputChannel);
const config = workspace.getConfiguration('git');
const enabled = config.get<boolean>('enabled') === true;
const rootPath = workspace.rootPath;
if (!rootPath) {
if (!rootPath || !enabled) {
const commandCenter = new CommandCenter(undefined, outputChannel);
disposables.push(commandCenter);
return;
}
@@ -38,7 +45,6 @@ async function init(disposables: Disposable[]): Promise<void> {
const repositoryRoot = await repository.getRoot();
const model = new Model(repositoryRoot, repository, onWorkspaceChange);
const outputChannel = window.createOutputChannel('Git');
outputChannel.appendLine(localize('using git', "Using git {0} from {1}", info.version, info.path));
git.onOutput(str => outputChannel.append(str), null, disposables);
@@ -56,7 +62,6 @@ async function init(disposables: Disposable[]): Promise<void> {
commandCenter,
provider,
contentProvider,
outputChannel,
fsWatcher,
checkoutStatusBar,
syncStatusBar,