Browse Source

Fixes diff w/ working on virtual repos

Refs: #2300
main
Eric Amodio 2 years ago
parent
commit
e9051db241
3 changed files with 9 additions and 6 deletions
  1. +3
    -2
      src/env/node/git/localGitProvider.ts
  2. +3
    -2
      src/git/gitProviderService.ts
  3. +3
    -2
      src/plus/github/githubGitProvider.ts

+ 3
- 2
src/env/node/git/localGitProvider.ts View File

@ -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);

+ 3
- 2
src/git/gitProviderService.ts View File

@ -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);

+ 3
- 2
src/plus/github/githubGitProvider.ts View File

@ -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);

||||||
x
 
000:0
Loading…
Cancel
Save