瀏覽代碼

Adds support for git: url schemes

main
Eric Amodio 7 年之前
父節點
當前提交
b907b910e7
共有 2 個文件被更改,包括 21 次插入4 次删除
  1. +9
    -1
      CHANGELOG.md
  2. +12
    -3
      src/git/gitUri.ts

+ 9
- 1
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

+ 12
- 3
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);

Loading…
取消
儲存