Pārlūkot izejas kodu

Adds support for git: url schemes

main
Eric Amodio pirms 7 gadiem
vecāks
revīzija
b907b910e7
2 mainītis faili ar 21 papildinājumiem un 4 dzēšanām
  1. +9
    -1
      CHANGELOG.md
  2. +12
    -3
      src/git/gitUri.ts

+ 9
- 1
CHANGELOG.md Parādīt failu

@ -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 Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt