mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:03:42 +01:00
git api: make cwd mandatory
This commit is contained in:
@@ -36,12 +36,11 @@ export class ApiGit implements Git {
|
||||
|
||||
constructor(private _model: Model) { }
|
||||
|
||||
exec(cwd: string, args: string[], options: SpawnOptions = {}): Promise<ExecResult<string>> {
|
||||
return this._model.git.exec(cwd, args, options);
|
||||
exec(args: string[], options: SpawnOptions): Promise<ExecResult<string>> {
|
||||
return this._model.git.exec2(args, options);
|
||||
}
|
||||
|
||||
spawn(cwd: string, args: string[], options: SpawnOptions = {}): cp.ChildProcess {
|
||||
options = { cwd, ...options };
|
||||
spawn(args: string[], options: SpawnOptions): cp.ChildProcess {
|
||||
return this._model.git.spawn(args, options);
|
||||
}
|
||||
}
|
||||
|
||||
5
extensions/git/src/api/git.d.ts
vendored
5
extensions/git/src/api/git.d.ts
vendored
@@ -13,6 +13,7 @@ export interface ExecResult<T extends string | Buffer> {
|
||||
}
|
||||
|
||||
export interface SpawnOptions extends cp.SpawnOptions {
|
||||
readonly cwd: string;
|
||||
readonly input?: string;
|
||||
readonly encoding?: string;
|
||||
readonly log?: boolean;
|
||||
@@ -21,8 +22,8 @@ export interface SpawnOptions extends cp.SpawnOptions {
|
||||
|
||||
export interface Git {
|
||||
readonly path: string;
|
||||
exec(cwd: string, args: string[], options?: SpawnOptions): Promise<ExecResult<string>>;
|
||||
spawn(cwd: string, args: string[], options?: SpawnOptions): cp.ChildProcess;
|
||||
exec(args: string[], options: SpawnOptions): Promise<ExecResult<string>>;
|
||||
spawn(args: string[], options: SpawnOptions): cp.ChildProcess;
|
||||
}
|
||||
|
||||
export interface API {
|
||||
|
||||
Reference in New Issue
Block a user