Browse Source

Fixes #739 - breadcrumbs within the repo now work

main
Eric Amodio 5 years ago
parent
commit
5e6c0ead79
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      src/git/gitUri.ts

+ 5
- 4
src/git/gitUri.ts View File

@ -56,13 +56,13 @@ export class GitUri extends ((Uri as any) as UriEx) {
// When Uri's come from the FileSystemProvider, the uri.query only contains the root repo info (not the actual file path), so fix that here // When Uri's come from the FileSystemProvider, the uri.query only contains the root repo info (not the actual file path), so fix that here
const index = uri.path.indexOf(data.path); const index = uri.path.indexOf(data.path);
if (index + data.path.length < uri.path.length) { if (index + data.path.length < uri.path.length) {
data.path = uri.path.substr(index);
data.path = index === 0 ? uri.path : uri.path.substr(index);
} }
super({ super({
scheme: uri.scheme, scheme: uri.scheme,
authority: uri.authority, authority: uri.authority,
path: data.path,
path: uri.path,
query: JSON.stringify(data), query: JSON.stringify(data),
fragment: uri.fragment fragment: uri.fragment
}); });
@ -399,10 +399,11 @@ export class GitUri extends ((Uri as any) as UriEx) {
shortSha = GitService.shortenSha(ref); shortSha = GitService.shortenSha(ref);
} }
else { else {
fileName = uriOrRef.fsPath!;
repoPath = uriOrRef.repoPath!;
fileName = uriOrRef.fsPath;
ref = uriOrRef.sha; ref = uriOrRef.sha;
shortSha = uriOrRef.shortSha; shortSha = uriOrRef.shortSha;
repoPath = uriOrRef.repoPath!;
} }
if (ref == null || ref.length === 0) { if (ref == null || ref.length === 0) {

Loading…
Cancel
Save