diff --git a/src/env/node/git/localGitProvider.ts b/src/env/node/git/localGitProvider.ts index 7168e96..31a78b3 100644 --- a/src/env/node/git/localGitProvider.ts +++ b/src/env/node/git/localGitProvider.ts @@ -694,8 +694,9 @@ export class LocalGitProvider implements GitProvider, Disposable { } // Short-circuit if the path is relative - if (typeof pathOrUri === 'string' && !isAbsolute(pathOrUri)) { - return Uri.joinPath(base, normalizePath(pathOrUri)); + if (typeof pathOrUri === 'string') { + const normalized = normalizePath(pathOrUri); + if (!isAbsolute(normalized)) return Uri.joinPath(base, normalized); } const relativePath = this.getRelativePath(pathOrUri, base); diff --git a/src/git/gitProviderService.ts b/src/git/gitProviderService.ts index e2cd271..a712832 100644 --- a/src/git/gitProviderService.ts +++ b/src/git/gitProviderService.ts @@ -856,8 +856,9 @@ export class GitProviderService implements Disposable { } // Short-circuit if the base is already a Uri and the path is relative - if (typeof base !== 'string' && typeof pathOrUri === 'string' && !isAbsolute(pathOrUri)) { - return Uri.joinPath(base, normalizePath(pathOrUri)); + if (typeof base !== 'string' && typeof pathOrUri === 'string') { + const normalized = normalizePath(pathOrUri); + if (!isAbsolute(normalized)) return Uri.joinPath(base, normalized); } const { provider } = this.getProvider(base); diff --git a/src/plus/github/githubGitProvider.ts b/src/plus/github/githubGitProvider.ts index 5bb88b4..b25d4a3 100644 --- a/src/plus/github/githubGitProvider.ts +++ b/src/plus/github/githubGitProvider.ts @@ -281,8 +281,9 @@ export class GitHubGitProvider implements GitProvider, Disposable { } } - if (typeof pathOrUri === 'string' && !maybeUri(pathOrUri) && !isAbsolute(pathOrUri)) { - return Uri.joinPath(base, normalizePath(pathOrUri)); + if (typeof pathOrUri === 'string' && !maybeUri(pathOrUri)) { + const normalized = normalizePath(pathOrUri); + if (!isAbsolute(normalized)) return Uri.joinPath(base, normalized); } const relativePath = this.getRelativePath(pathOrUri, base);