diff --git a/src/env/node/git/git.ts b/src/env/node/git/git.ts index 2886590a0c8be..a964fef92593f 100644 --- a/src/env/node/git/git.ts +++ b/src/env/node/git/git.ts @@ -2056,7 +2056,7 @@ export class Git { const scope = getLogScope(); const location = await this.getLocation(); - const git = location.path ?? 'git'; + const git = normalizePath(location.path ?? 'git'); const coreEditorConfig = configuration.get('terminal.overrideGitEditor') ? `-c "core.editor=${getEditorCommand()}" ` diff --git a/src/env/node/git/shell.ts b/src/env/node/git/shell.ts index 783572c186dc6..9825fbf9799ad 100644 --- a/src/env/node/git/shell.ts +++ b/src/env/node/git/shell.ts @@ -6,6 +6,7 @@ import { join as joinPaths } from 'path'; import * as process from 'process'; import type { CancellationToken } from 'vscode'; import { Logger } from '../../../system/logger'; +import { normalizePath } from '../../../system/path'; export const isWindows = process.platform === 'win32'; @@ -124,7 +125,7 @@ export async function getWindowsShortPath(path: string): Promise { return; } - resolve(stdout.trim().replace(/\\/g, '/')); + resolve(normalizePath(stdout.trim())); }); }); }