Skip to content

Commit b907b91

Browse files
committed
Adds support for git: url schemes
1 parent 204b2de commit b907b91

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [Unreleased]
8+
### Added
9+
- Adds support for vscode's Git file revisions (e.g. `Open File (HEAD)`) and diffs (e.g. `Open Changes`)
10+
- Adds new entry in the `History View` of the `GitLens` view
11+
- Adds blame annotations, navigation & comparison commands, etc
12+
713
## [6.3.0-beta] - 2017-11-27
814
### Added
9-
- Adds support for staged changes in the `GitLens` view, blame annotations, comparison commands, etc
15+
- Adds support for files with staged changes
16+
- Adds new entry in the `History View` of the `GitLens` view
17+
- Adds blame annotations, navigation & comparison commands, etc
1018

1119
## [6.2.0] - 2017-11-27
1220
### Added

src/git/gitUri.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,19 @@ export class GitUri extends ((Uri as any) as UriEx) {
101101

102102
if (uri.scheme === DocumentSchemes.GitLensGit) return new GitUri(uri);
103103

104-
// If this is a git uri, assume it is showing the most recent commit
104+
// If this is a git uri, find its repoPath
105105
if (uri.scheme === DocumentSchemes.Git) {
106-
const commit = await git.getLogCommit(undefined, uri.fsPath);
107-
if (commit !== undefined) return new GitUri(uri, commit);
106+
const data: { path: string, ref: string } = JSON.parse(uri.query);
107+
108+
const repoPath = await git.getRepoPath(data.path);
109+
110+
return new GitUri(uri, {
111+
fileName: data.path,
112+
repoPath: repoPath,
113+
sha: data.ref === '' || data.ref == null
114+
? undefined
115+
: data.ref
116+
} as IGitCommitInfo);
108117
}
109118

110119
const gitUri = git.getGitUriForVersionedFile(uri);

0 commit comments

Comments
 (0)