git.enabled as a resource setting

fixes #37492
This commit is contained in:
Joao Moreno
2017-11-27 16:08:06 +01:00
parent e69ca9ff85
commit 9544e5faa0
3 changed files with 32 additions and 51 deletions

View File

@@ -22,8 +22,6 @@ async function init(context: ExtensionContext, outputChannel: OutputChannel, dis
const telemetryReporter: TelemetryReporter = new TelemetryReporter(name, version, aiKey);
disposables.push(telemetryReporter);
const config = workspace.getConfiguration('git');
const enabled = config.get<boolean>('enabled') === true;
const pathHint = workspace.getConfiguration('git').get<string>('path');
const info = await findGit(pathHint, path => outputChannel.appendLine(localize('looking', "Looking for git in: {0}", path)));
const askpass = new Askpass();
@@ -37,12 +35,6 @@ async function init(context: ExtensionContext, outputChannel: OutputChannel, dis
model.onDidCloseRepository(onRepository, null, disposables);
onRepository();
if (!enabled) {
const commandCenter = new CommandCenter(git, model, outputChannel, telemetryReporter);
disposables.push(commandCenter);
return;
}
outputChannel.appendLine(localize('using git', "Using git {0} from {1}", info.version, info.path));
const onOutput = (str: string) => outputChannel.append(str);