/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ 'use strict'; import { IRawGitService, IRawStatus, ServiceState, RawServiceState } from 'vs/workbench/parts/git/common/git'; import { TPromise } from 'vs/base/common/winjs.base'; import Event, { Emitter } from 'vs/base/common/event'; import { ILogOptions } from 'vs/workbench/parts/git/node/git.lib'; export class NoOpGitService implements IRawGitService { private _onOutput = new Emitter(); get onOutput(): Event { return this._onOutput.event; } private static STATUS:IRawStatus = { repositoryRoot: null, state: ServiceState.NotAWorkspace, status: [], HEAD: null, refs: [], remotes: [] }; getVersion(): TPromise { return TPromise.as(null); } serviceState(): TPromise { return TPromise.as(RawServiceState.OK); } statusCount(): TPromise { return TPromise.as(0); } status(): TPromise { return TPromise.as(NoOpGitService.STATUS); } init(): TPromise { return TPromise.as(NoOpGitService.STATUS); } add(filesPaths?: string[]): TPromise { return TPromise.as(NoOpGitService.STATUS); } stage(filePath: string, content: string): TPromise { return TPromise.as(NoOpGitService.STATUS); } branch(name: string, checkout?: boolean): TPromise { return TPromise.as(NoOpGitService.STATUS); } checkout(treeish?: string, filePaths?: string[]): TPromise { return TPromise.as(NoOpGitService.STATUS); } clean(filePaths: string[]): TPromise { return TPromise.as(NoOpGitService.STATUS); } undo(): TPromise { return TPromise.as(NoOpGitService.STATUS); } reset(treeish: string, hard?: boolean): TPromise { return TPromise.as(NoOpGitService.STATUS); } revertFiles(treeish: string, filePaths?: string[]): TPromise { return TPromise.as(NoOpGitService.STATUS); } fetch(): TPromise { return TPromise.as(NoOpGitService.STATUS); } pull(rebase?: boolean): TPromise { return TPromise.as(NoOpGitService.STATUS); } push(): TPromise { return TPromise.as(NoOpGitService.STATUS); } sync(): TPromise { return TPromise.as(NoOpGitService.STATUS); } commit(message: string, amend?: boolean, stage?: boolean): TPromise { return TPromise.as(NoOpGitService.STATUS); } detectMimetypes(path: string, treeish?: string): TPromise { return TPromise.as([]); } show(path: string, treeish?: string): TPromise { return TPromise.as(null); } getCommitTemplate(): TPromise { return TPromise.as(null); } getLog(options?: ILogOptions): TPromise { return TPromise.as(null); } }