diff --git a/CHANGELOG.md b/CHANGELOG.md index 00add15..63ae897 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Added +- Adds support for vscode's Git file revisions (e.g. `Open File (HEAD)`) and diffs (e.g. `Open Changes`) + - Adds new entry in the `History View` of the `GitLens` view + - Adds blame annotations, navigation & comparison commands, etc + ## [6.3.0-beta] - 2017-11-27 ### Added -- Adds support for staged changes in the `GitLens` view, blame annotations, comparison commands, etc +- Adds support for files with staged changes + - Adds new entry in the `History View` of the `GitLens` view + - Adds blame annotations, navigation & comparison commands, etc ## [6.2.0] - 2017-11-27 ### Added diff --git a/src/git/gitUri.ts b/src/git/gitUri.ts index aa50b3d..c96e08f 100644 --- a/src/git/gitUri.ts +++ b/src/git/gitUri.ts @@ -101,10 +101,19 @@ export class GitUri extends ((Uri as any) as UriEx) { if (uri.scheme === DocumentSchemes.GitLensGit) return new GitUri(uri); - // If this is a git uri, assume it is showing the most recent commit + // If this is a git uri, find its repoPath if (uri.scheme === DocumentSchemes.Git) { - const commit = await git.getLogCommit(undefined, uri.fsPath); - if (commit !== undefined) return new GitUri(uri, commit); + const data: { path: string, ref: string } = JSON.parse(uri.query); + + const repoPath = await git.getRepoPath(data.path); + + return new GitUri(uri, { + fileName: data.path, + repoPath: repoPath, + sha: data.ref === '' || data.ref == null + ? undefined + : data.ref + } as IGitCommitInfo); } const gitUri = git.getGitUriForVersionedFile(uri);