From 1a122db7f90a0fc80852db9b98e55a92b8435ed5 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 7 Jan 2025 18:16:16 -0500 Subject: [PATCH] Renames git/gitSpawn to exec/spawn --- src/env/node/git/git.ts | 173 ++++++++++++++------------- src/env/node/git/localGitProvider.ts | 12 +- src/env/node/git/vslsGitProvider.ts | 7 +- src/env/node/providers.ts | 2 +- 4 files changed, 101 insertions(+), 93 deletions(-) diff --git a/src/env/node/git/git.ts b/src/env/node/git/git.ts index cb2b41a1e0909..8762cbc1e0da6 100644 --- a/src/env/node/git/git.ts +++ b/src/env/node/git/git.ts @@ -177,9 +177,9 @@ export class Git { /** Map of running git commands -- avoids running duplicate overlaping commands */ private readonly pendingCommands = new Map>(); - async git(options: ExitCodeOnlyGitCommandOptions, ...args: any[]): Promise; - async git(options: GitCommandOptions, ...args: any[]): Promise; - async git(options: GitCommandOptions, ...args: any[]): Promise { + async exec(options: ExitCodeOnlyGitCommandOptions, ...args: any[]): Promise; + async exec(options: GitCommandOptions, ...args: any[]): Promise; + async exec(options: GitCommandOptions, ...args: any[]): Promise { if (!workspace.isTrusted) throw new WorkspaceUntrustedError(); const start = hrtime(); @@ -260,7 +260,7 @@ export class Git { } } - async gitSpawn(options: GitSpawnOptions, ...args: any[]): Promise { + async spawn(options: GitSpawnOptions, ...args: any[]): Promise { if (!workspace.isTrusted) throw new WorkspaceUntrustedError(); const start = hrtime(); @@ -362,7 +362,7 @@ export class Git { // Git commands add(repoPath: string | undefined, pathspecs: string[], ...args: string[]) { - return this.git({ cwd: repoPath }, 'add', ...args, '--', ...pathspecs); + return this.exec({ cwd: repoPath }, 'add', ...args, '--', ...pathspecs); } apply(repoPath: string | undefined, patch: string, options: { allowConflicts?: boolean } = {}) { @@ -370,7 +370,7 @@ export class Git { if (options.allowConflicts) { params.push('-3'); } - return this.git({ cwd: repoPath, stdin: patch }, ...params); + return this.exec({ cwd: repoPath, stdin: patch }, ...params); } async apply2( @@ -384,7 +384,7 @@ export class Git { }, ...args: string[] ) { - return this.git( + return this.exec( { cwd: repoPath, cancellation: options?.cancellation, @@ -497,7 +497,7 @@ export class Git { } try { - const blame = await this.git( + const blame = await this.exec( { cwd: root, stdin: stdin, correlationKey: options?.correlationKey }, ...params, '--', @@ -521,11 +521,11 @@ export class Git { } branch(repoPath: string, ...args: string[]) { - return this.git({ cwd: repoPath }, 'branch', ...args); + return this.exec({ cwd: repoPath }, 'branch', ...args); } branch__set_upstream(repoPath: string, branch: string, remote: string, remoteBranch: string) { - return this.git({ cwd: repoPath }, 'branch', '--set-upstream-to', `${remote}/${remoteBranch}`, branch); + return this.exec({ cwd: repoPath }, 'branch', '--set-upstream-to', `${remote}/${remoteBranch}`, branch); } branchOrTag__containsOrPointsAt( @@ -556,19 +556,19 @@ export class Git { params.push(options.name); } - return this.git( + return this.exec( { cwd: repoPath, configs: gitBranchDefaultConfigs, errors: GitErrorHandling.Ignore }, ...params, ); } async cat_file__size(repoPath: string, oid: string): Promise { - const data = await this.git({ cwd: repoPath }, 'cat-file', '-s', oid); + const data = await this.exec({ cwd: repoPath }, 'cat-file', '-s', oid); return data.length ? parseInt(data.trim(), 10) : 0; } check_ignore(repoPath: string, ...files: string[]) { - return this.git( + return this.exec( { cwd: repoPath, errors: GitErrorHandling.Ignore, stdin: files.join('\0') }, 'check-ignore', '-z', @@ -577,7 +577,7 @@ export class Git { } check_mailmap(repoPath: string, author: string) { - return this.git({ cwd: repoPath, errors: GitErrorHandling.Ignore }, 'check-mailmap', author); + return this.exec({ cwd: repoPath, errors: GitErrorHandling.Ignore }, 'check-mailmap', author); } async check_ref_format(ref: string, repoPath?: string, options: { branch?: boolean } = { branch: true }) { @@ -589,7 +589,7 @@ export class Git { } try { - const data = await this.git( + const data = await this.exec( { cwd: repoPath ?? '', errors: GitErrorHandling.Throw }, ...params, ref, @@ -614,7 +614,7 @@ export class Git { } } - return this.git({ cwd: repoPath }, ...params); + return this.exec({ cwd: repoPath }, ...params); } async cherrypick(repoPath: string, sha: string, options: { noCommit?: boolean; errors?: GitErrorHandling } = {}) { @@ -625,7 +625,7 @@ export class Git { params.push(sha); try { - await this.git({ cwd: repoPath, errors: options?.errors }, ...params); + await this.exec({ cwd: repoPath, errors: options?.errors }, ...params); } catch (ex) { const msg: string = ex?.toString() ?? ''; let reason: CherryPickErrorReason = CherryPickErrorReason.Other; @@ -655,13 +655,13 @@ export class Git { folderPath = joinPath(parentPath, `${remotePath}-${count}`); } - await this.git({ cwd: parentPath }, 'clone', url, folderPath); + await this.exec({ cwd: parentPath }, 'clone', url, folderPath); return folderPath; } async config__get(key: string, repoPath?: string, options?: { local?: boolean }) { - const data = await this.git( + const data = await this.exec( { cwd: repoPath ?? '', errors: GitErrorHandling.Ignore, local: options?.local }, 'config', '--get', @@ -671,7 +671,7 @@ export class Git { } async config__get_regex(pattern: string, repoPath?: string, options?: { local?: boolean }) { - const data = await this.git( + const data = await this.exec( { cwd: repoPath ?? '', errors: GitErrorHandling.Ignore, local: options?.local }, 'config', '--get-regex', @@ -687,7 +687,7 @@ export class Git { } else { params.push(key, value); } - await this.git({ cwd: repoPath ?? '', local: true }, ...params); + await this.exec({ cwd: repoPath ?? '', local: true }, ...params); } async diff( @@ -729,7 +729,7 @@ export class Git { } try { - return await this.git( + return await this.exec( { cwd: repoPath, configs: gitDiffDefaultConfigs, @@ -764,7 +764,7 @@ export class Git { }, ...args: string[] ) { - return this.git( + return this.exec( { cwd: repoPath, cancellation: options?.cancellation, @@ -807,7 +807,7 @@ export class Git { params.push('--no-index'); try { - return await this.git( + return await this.exec( { cwd: repoPath, configs: gitDiffDefaultConfigs, @@ -867,7 +867,7 @@ export class Git { params.push(options.path); } - return this.git({ cwd: repoPath, configs: gitDiffDefaultConfigs }, ...params); + return this.exec({ cwd: repoPath, configs: gitDiffDefaultConfigs }, ...params); } async diff__shortstat(repoPath: string, ref?: string) { @@ -877,7 +877,7 @@ export class Git { } try { - return await this.git({ cwd: repoPath, configs: gitDiffDefaultConfigs }, ...params, '--'); + return await this.exec({ cwd: repoPath, configs: gitDiffDefaultConfigs }, ...params, '--'); } catch (ex) { const msg: string = ex?.toString() ?? ''; if (GitErrors.noMergeBase.test(msg)) { @@ -905,7 +905,7 @@ export class Git { params.push(options.ref2); } - return this.git({ cwd: repoPath }, ...params, '--', fileName); + return this.exec({ cwd: repoPath }, ...params, '--', fileName); } difftool__dir_diff(repoPath: string, tool: string, ref1: string, ref2?: string) { @@ -914,7 +914,7 @@ export class Git { params.push(ref2); } - return this.git({ cwd: repoPath }, ...params); + return this.exec({ cwd: repoPath }, ...params); } async fetch( @@ -949,7 +949,7 @@ export class Git { } try { - void (await this.git({ cwd: repoPath }, ...params)); + void (await this.exec({ cwd: repoPath }, ...params)); } catch (ex) { const msg: string = ex?.toString() ?? ''; let reason: FetchErrorReason = FetchErrorReason.Other; @@ -1006,7 +1006,7 @@ export class Git { } try { - void (await this.git({ cwd: repoPath }, ...params)); + void (await this.exec({ cwd: repoPath }, ...params)); } catch (ex) { const msg: string = ex?.toString() ?? ''; let reason: PushErrorReason = PushErrorReason.Other; @@ -1053,7 +1053,7 @@ export class Git { } try { - void (await this.git({ cwd: repoPath }, ...params)); + void (await this.exec({ cwd: repoPath }, ...params)); } catch (ex) { const msg: string = ex?.toString() ?? ''; let reason: PullErrorReason = PullErrorReason.Other; @@ -1098,7 +1098,7 @@ export class Git { params.push('refs/remotes'); } - return this.git({ cwd: repoPath }, ...params); + return this.exec({ cwd: repoPath }, ...params); } log( @@ -1112,7 +1112,7 @@ export class Git { }, ...args: string[] ) { - return this.git( + return this.exec( { cwd: repoPath, cancellation: options?.cancellation, @@ -1140,7 +1140,7 @@ export class Git { params.push('--stdin'); } - const proc = await this.gitSpawn( + const proc = await this.spawn( { cwd: repoPath, configs: options?.configs ?? gitLogDefaultConfigs, stdin: options?.stdin }, ...params, '--', @@ -1319,7 +1319,7 @@ export class Git { params.push('--', file); } - return this.git({ cwd: root, configs: gitLogDefaultConfigs }, ...params); + return this.exec({ cwd: root, configs: gitLogDefaultConfigs }, ...params); } async log__file_recent( @@ -1347,7 +1347,7 @@ export class Git { params.push(options?.ref); } - const data = await this.git( + const data = await this.exec( { cancellation: options?.cancellation, cwd: repoPath, @@ -1379,7 +1379,7 @@ export class Git { params.push('--', file); } - const data = await this.git( + const data = await this.exec( { cancellation: cancellation, cwd: repoPath, @@ -1398,7 +1398,7 @@ export class Git { params.push(`--${ordering}-order`); } - const data = await this.git( + const data = await this.exec( { cwd: repoPath, configs: gitLogDefaultConfigs, errors: GitErrorHandling.Ignore }, ...params, '--', @@ -1414,7 +1414,7 @@ export class Git { params.push(`--${ordering}-order`); } - const data = await this.git( + const data = await this.exec( { cwd: repoPath, configs: gitLogDefaultConfigs, errors: GitErrorHandling.Ignore }, ...params, '--', @@ -1436,7 +1436,7 @@ export class Git { ) { if (options?.shas != null) { const stdin = join(options.shas, '\n'); - return this.git( + return this.exec( { cwd: repoPath, stdin: stdin }, 'show', '--stdin', @@ -1449,7 +1449,7 @@ export class Git { let files; [search, files] = splitAt(search, search.indexOf('--')); - return this.git( + return this.exec( { cwd: repoPath, configs: ['-C', repoPath, ...gitLogDefaultConfigs], stdin: options?.stdin }, 'log', ...(options?.stdin ? ['--stdin'] : emptyArray), @@ -1490,7 +1490,7 @@ export class Git { params.push('-o'); } - const data = await this.git( + const data = await this.exec( { cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params, '--', @@ -1500,11 +1500,11 @@ export class Git { } ls_remote(repoPath: string, remote: string, ref?: string) { - return this.git({ cwd: repoPath }, 'ls-remote', remote, ref); + return this.exec({ cwd: repoPath }, 'ls-remote', remote, ref); } ls_remote__HEAD(repoPath: string, remote: string) { - return this.git({ cwd: repoPath }, 'ls-remote', '--symref', remote, 'HEAD'); + return this.exec({ cwd: repoPath }, 'ls-remote', '--symref', remote, 'HEAD'); } async ls_tree(repoPath: string, ref: string, path?: string) { @@ -1514,7 +1514,7 @@ export class Git { } else { params.push('-lrt', ref, '--'); } - const data = await this.git({ cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params); + const data = await this.exec({ cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params); return data.length === 0 ? undefined : data.trim(); } @@ -1524,18 +1524,18 @@ export class Git { params.push('--fork-point'); } - return this.git({ cwd: repoPath }, ...params, ref1, ref2); + return this.exec({ cwd: repoPath }, ...params, ref1, ref2); } async merge_base__is_ancestor(repoPath: string, ref1: string, ref2: string): Promise { const params = ['merge-base', '--is-ancestor']; - const exitCode = await this.git({ cwd: repoPath, exitCodeOnly: true }, ...params, ref1, ref2); + const exitCode = await this.exec({ cwd: repoPath, exitCodeOnly: true }, ...params, ref1, ref2); return exitCode === 0; } async merge_tree(repoPath: string, branch: string, target: string, ...args: string[]): Promise { try { - return await this.git( + return await this.exec( { cwd: repoPath, errors: GitErrorHandling.Throw }, 'merge-tree', ...args, @@ -1575,7 +1575,7 @@ export class Git { }, ...args: string[] ): Promise { - return this.git( + return this.exec( { cwd: repoPath, cancellation: options?.cancellation, @@ -1592,7 +1592,7 @@ export class Git { } remote(repoPath: string): Promise { - return this.git({ cwd: repoPath }, 'remote', '-v'); + return this.exec({ cwd: repoPath }, 'remote', '-v'); } remote__add(repoPath: string, name: string, url: string, options?: { fetch?: boolean }) { @@ -1600,23 +1600,23 @@ export class Git { if (options?.fetch) { params.push('-f'); } - return this.git({ cwd: repoPath }, ...params, name, url); + return this.exec({ cwd: repoPath }, ...params, name, url); } remote__prune(repoPath: string, name: string) { - return this.git({ cwd: repoPath }, 'remote', 'prune', name); + return this.exec({ cwd: repoPath }, 'remote', 'prune', name); } remote__remove(repoPath: string, name: string) { - return this.git({ cwd: repoPath }, 'remote', 'remove', name); + return this.exec({ cwd: repoPath }, 'remote', 'remove', name); } remote__get_url(repoPath: string, remote: string): Promise { - return this.git({ cwd: repoPath }, 'remote', 'get-url', remote); + return this.exec({ cwd: repoPath }, 'remote', 'get-url', remote); } reset(repoPath: string | undefined, pathspecs: string[]) { - return this.git({ cwd: repoPath }, 'reset', '-q', '--', ...pathspecs); + return this.exec({ cwd: repoPath }, 'reset', '-q', '--', ...pathspecs); } async rev_list( @@ -1637,7 +1637,7 @@ export class Git { params.push(`--since="${options.since}"`, '--date-order'); } - const rawData = await this.git( + const rawData = await this.exec( { cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params, ref, @@ -1655,7 +1655,7 @@ export class Git { params.push('--all'); } - let data = await this.git({ cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params, ref, '--'); + let data = await this.exec({ cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params, ref, '--'); data = data.trim(); if (data.length === 0) return undefined; @@ -1679,7 +1679,12 @@ export class Git { params.push('--no-merges'); } - const data = await this.git({ cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params, range, '--'); + const data = await this.exec( + { cwd: repoPath, errors: GitErrorHandling.Ignore }, + ...params, + range, + '--', + ); if (data.length === 0) return undefined; const parts = data.split('\t'); @@ -1697,7 +1702,7 @@ export class Git { } async rev_parse(repoPath: string, ref: string): Promise { - const data = await this.git({ cwd: repoPath, errors: GitErrorHandling.Ignore }, 'rev-parse', ref); + const data = await this.exec({ cwd: repoPath, errors: GitErrorHandling.Ignore }, 'rev-parse', ref); return data.length === 0 ? undefined : data.trim(); } @@ -1706,7 +1711,7 @@ export class Git { ordering: 'date' | 'author-date' | 'topo' | null, ): Promise<[string, string | undefined] | undefined> { try { - const data = await this.git( + const data = await this.exec( { cwd: repoPath, errors: GitErrorHandling.Throw }, 'rev-parse', '--abbrev-ref', @@ -1781,7 +1786,7 @@ export class Git { } async rev_parse__git_dir(cwd: string): Promise<{ path: string; commonPath?: string } | undefined> { - const data = await this.git( + const data = await this.exec( { cwd: cwd, errors: GitErrorHandling.Ignore }, 'rev-parse', '--git-dir', @@ -1818,7 +1823,7 @@ export class Git { // Check if the folder is a bare clone: if it has a file named HEAD && `rev-parse --show-cdup` is empty try { accessSync(joinPaths(cwd, 'HEAD')); - data = await this.git( + data = await this.exec( { cwd: cwd, errors: GitErrorHandling.Throw, configs: ['-C', cwd] }, 'rev-parse', '--show-cdup', @@ -1833,7 +1838,11 @@ export class Git { } try { - data = await this.git({ cwd: cwd, errors: GitErrorHandling.Throw }, 'rev-parse', '--show-toplevel'); + data = await this.exec( + { cwd: cwd, errors: GitErrorHandling.Throw }, + 'rev-parse', + '--show-toplevel', + ); // Make sure to normalize: https://github.com/git-for-windows/git/issues/2478 // Keep trailing spaces which are part of the directory name return data.length === 0 @@ -1856,7 +1865,7 @@ export class Git { const inDotGit = /this operation must be run in a work tree/.test(ex.stderr); // Check if we are in a bare clone if (inDotGit && workspace.isTrusted) { - data = await this.git( + data = await this.exec( { cwd: cwd, errors: GitErrorHandling.Ignore }, 'rev-parse', '--is-bare-repository', @@ -1894,7 +1903,7 @@ export class Git { params.push('--end-of-options'); } - const data = await this.git( + const data = await this.exec( { cwd: repoPath, errors: GitErrorHandling.Ignore }, ...params, fileName ? `${ref}:./${fileName}` : `${ref}^{commit}`, @@ -1907,7 +1916,7 @@ export class Git { options?: { cancellation?: CancellationToken; configs?: readonly string[] }, ...args: string[] ) { - return this.git( + return this.exec( { cwd: repoPath, cancellation: options?.cancellation, @@ -1943,7 +1952,7 @@ export class Git { const args = ref.endsWith(':') ? `${ref}./${file}` : `${ref}:./${file}`; try { - const data = await this.git(opts, 'show', '--textconv', args, '--'); + const data = await this.exec(opts, 'show', '--textconv', args, '--'); return data; } catch (ex) { const msg: string = ex?.toString() ?? ''; @@ -1965,12 +1974,12 @@ export class Git { stash__apply(repoPath: string, stashName: string, deleteAfter: boolean): Promise { if (!stashName) return Promise.resolve(undefined); - return this.git({ cwd: repoPath }, 'stash', deleteAfter ? 'pop' : 'apply', stashName); + return this.exec({ cwd: repoPath }, 'stash', deleteAfter ? 'pop' : 'apply', stashName); } async stash__rename(repoPath: string, stashName: string, ref: string, message: string, stashOnRef?: string) { await this.stash__delete(repoPath, stashName, ref); - return this.git( + return this.exec( { cwd: repoPath }, 'stash', 'store', @@ -1984,7 +1993,7 @@ export class Git { if (!stashName) return undefined; if (ref) { - const stashRef = await this.git( + const stashRef = await this.exec( { cwd: repoPath, errors: GitErrorHandling.Ignore }, 'show', '--format=%H', @@ -1996,7 +2005,7 @@ export class Git { } } - return this.git({ cwd: repoPath }, 'stash', 'drop', stashName); + return this.exec({ cwd: repoPath }, 'stash', 'drop', stashName); } stash__list( @@ -2007,7 +2016,7 @@ export class Git { args = ['--name-status']; } - return this.git( + return this.exec( { cwd: repoPath }, 'stash', 'list', @@ -2019,7 +2028,7 @@ export class Git { async stash__create(repoPath: string): Promise { const params = ['stash', 'create']; - const data = await this.git({ cwd: repoPath }, ...params); + const data = await this.exec({ cwd: repoPath }, ...params); return data?.trim() || undefined; } @@ -2032,7 +2041,7 @@ export class Git { params.push(sha); - await this.git({ cwd: repoPath }, ...params); + await this.exec({ cwd: repoPath }, ...params); } async stash__push( @@ -2081,7 +2090,7 @@ export class Git { } try { - const data = await this.git({ cwd: repoPath, stdin: stdin }, ...params); + const data = await this.exec({ cwd: repoPath, stdin: stdin }, ...params); if (data.includes('No local changes to save')) { throw new StashPushError(StashPushErrorReason.NothingToSave); return; @@ -2099,7 +2108,7 @@ export class Git { } stash(repoPath: string, ...args: string[]) { - return this.git({ cwd: repoPath }, 'stash', ...args); + return this.exec({ cwd: repoPath }, 'stash', ...args); } async status( @@ -2119,7 +2128,7 @@ export class Git { ); } - return this.git( + return this.exec( { cwd: repoPath, configs: gitStatusDefaultConfigs, env: { GIT_OPTIONAL_LOCKS: '0' } }, ...params, '--', @@ -2127,12 +2136,12 @@ export class Git { } symbolic_ref(repoPath: string, ref: string) { - return this.git({ cwd: repoPath }, 'symbolic-ref', '--short', ref); + return this.exec({ cwd: repoPath }, 'symbolic-ref', '--short', ref); } async tag(repoPath: string, ...args: string[]) { try { - const output = await this.git({ cwd: repoPath }, 'tag', ...args); + const output = await this.exec({ cwd: repoPath }, 'tag', ...args); return output; } catch (ex) { const msg: string = ex?.toString() ?? ''; @@ -2169,11 +2178,11 @@ export class Git { if (commitish) { params.push(commitish); } - return this.git({ cwd: repoPath }, ...params); + return this.exec({ cwd: repoPath }, ...params); } worktree__list(repoPath: string) { - return this.git({ cwd: repoPath }, 'worktree', 'list', '--porcelain'); + return this.exec({ cwd: repoPath }, 'worktree', 'list', '--porcelain'); } worktree__remove(repoPath: string, worktree: string, { force }: { force?: boolean } = {}) { @@ -2183,7 +2192,7 @@ export class Git { } params.push(worktree); - return this.git({ cwd: repoPath, errors: GitErrorHandling.Throw }, ...params); + return this.exec({ cwd: repoPath, errors: GitErrorHandling.Throw }, ...params); } async readDotGitFile( diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 7c74ea57d3b15..036a2d0c42fe4 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -1387,7 +1387,7 @@ export class LocalGitProvider implements GitProvider, Disposable { // Create the temp index file from a base ref/sha // Get the tree of the base - const newIndex = await this.git.git( + const newIndex = await this.git.exec( { cwd: repoPath, env: env, @@ -1400,7 +1400,7 @@ export class LocalGitProvider implements GitProvider, Disposable { ); // Write the tree to our temp index - await this.git.git( + await this.git.exec( { cwd: repoPath, env: env, @@ -1416,7 +1416,7 @@ export class LocalGitProvider implements GitProvider, Disposable { // Create a new tree from our patched index const tree = ( - await this.git.git( + await this.git.exec( { cwd: repoPath, env: env, @@ -1427,7 +1427,7 @@ export class LocalGitProvider implements GitProvider, Disposable { // Create new commit from the tree const sha = ( - await this.git.git( + await this.git.exec( { cwd: repoPath, env: env, @@ -3018,7 +3018,7 @@ export class LocalGitProvider implements GitProvider, Disposable { } try { - const data = await this.git.git({ cwd: repoPath }, ...args); + const data = await this.git.exec({ cwd: repoPath }, ...args); if (data == null) return undefined; const contributions = data @@ -3325,7 +3325,7 @@ export class LocalGitProvider implements GitProvider, Disposable { } private async getValidatedBranchName(repoPath: string, name: string): Promise { - const data = await this.git.git( + const data = await this.git.exec( { cwd: repoPath }, 'rev-parse', '--verify', diff --git a/src/env/node/git/vslsGitProvider.ts b/src/env/node/git/vslsGitProvider.ts index 2fb27f349e757..6bfcdcd787bc6 100644 --- a/src/env/node/git/vslsGitProvider.ts +++ b/src/env/node/git/vslsGitProvider.ts @@ -17,11 +17,11 @@ export class VslsGit extends Git { super(); } - override async git(options: GitCommandOptions, ...args: any[]): Promise { + override async exec(options: GitCommandOptions, ...args: any[]): Promise { if (options.local) { // Since we will have a live share path here, just blank it out options.cwd = ''; - return this.localGit.git(options, ...args); + return this.localGit.exec(options, ...args); } const guest = await Container.instance.vsls.guest(); @@ -33,8 +33,7 @@ export class VslsGit extends Git { return guest.git(options, ...args); } - // eslint-disable-next-line @typescript-eslint/require-await - override async gitSpawn(_options: GitSpawnOptions, ..._args: any[]): Promise { + override spawn(_options: GitSpawnOptions, ..._args: any[]): Promise { debugger; throw new Error('Git spawn not supported in Live Share'); } diff --git a/src/env/node/providers.ts b/src/env/node/providers.ts index 6c64848bee413..aeb8bb4a9a298 100644 --- a/src/env/node/providers.ts +++ b/src/env/node/providers.ts @@ -19,7 +19,7 @@ function ensureGit() { } export function git(options: GitCommandOptions, ...args: any[]): Promise { - return ensureGit().git(options, ...args); + return ensureGit().exec(options, ...args); } export function gitLogStreamTo(