git: use simpler versioning scheme

This commit is contained in:
Joao Moreno
2018-08-22 15:09:11 +02:00
parent f9982d29d4
commit 78d61d55f4
7 changed files with 23 additions and 114 deletions

View File

@@ -6,24 +6,8 @@
import { Uri, SourceControlInputBox, Event, CancellationToken } from 'vscode';
import * as cp from 'child_process';
export interface ExecResult<T extends string | Buffer> {
readonly exitCode: number;
readonly stdout: T;
readonly stderr: string;
}
export interface SpawnOptions extends cp.SpawnOptions {
readonly cwd: string;
readonly input?: string;
readonly encoding?: string;
readonly log?: boolean;
readonly cancellationToken?: CancellationToken;
}
export interface Git {
readonly path: string;
exec(args: string[], options: SpawnOptions): Promise<ExecResult<string>>;
spawn(args: string[], options: SpawnOptions): cp.ChildProcess;
}
export interface API {
@@ -42,30 +26,13 @@ export interface Repository {
readonly inputBox: InputBox;
}
declare module GitExtension { }
export interface GitExtension {
/**
* Returns the latest available API compatible with the
* provided version range.
* Returns a specific API version.
*
* @param range Semver version range for API compatibility.
* @param version Version number.
* @returns API instance
*/
getAPI(range: string): API;
/**
* Returns the collection of active repositories.
*
* @deprecated Use `API.repositories` instead.
*/
getRepositories(): Promise<Repository[]>;
/**
* Returns the path to the current git executable.
*
* @deprecated Use `API.gitPath` instead.
*/
getGitPath(): Promise<string>;
getAPI(version: 1): API;
}