瀏覽代碼

Changes file history to always be the full history

main
Eric Amodio 6 年之前
父節點
當前提交
2cb5b9b37e
共有 2 個文件被更改,包括 23 次插入4 次删除
  1. +1
    -0
      CHANGELOG.md
  2. +22
    -4
      src/views/gitExplorer.ts

+ 1
- 0
CHANGELOG.md 查看文件

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Changed
- Renames the *GitLens History* explorer to *GitLens File History* explorer for better clarity
- Changes the *GitLens File History* explorer to always show the full file history even when reviewing revisions
### Removed
- Removes `gitlens:activeIsTracked`, `gitlens:activeIsBlameable`, `gitlens:activeIsRevision`, and `gitlens:activeHasRemotes` contexts and consolidates them into `gitlens:activeFileStatus` for better performance and UX

+ 22
- 4
src/views/gitExplorer.ts 查看文件

@ -37,6 +37,7 @@ import {
} from './explorerNodes';
import { GitUri } from '../gitService';
import { Logger } from '../logger';
import * as path from 'path';
export * from './explorerNodes';
@ -480,14 +481,31 @@ export class GitExplorer extends Disposable implements TreeDataProvider
// If we do have a visible trackable editor, don't change from the last state (avoids issues when focus switches to the problems/output/debug console panes)
if (editor.document === undefined || !Container.git.isTrackable(editor.document.uri)) return root;
const uri = await GitUri.fromUri(editor.document.uri);
let gitUri = await GitUri.fromUri(editor.document.uri);
const repo = await Container.git.getRepository(uri);
const repo = await Container.git.getRepository(gitUri);
if (repo === undefined) return undefined;
if (UriComparer.equals(uri, root && root.uri)) return root;
let uri;
if (gitUri.sha !== undefined) {
// If we have a sha, normalize the history to the working file (so we get a full history all the time)
const [fileName, repoPath] = await Container.git.findWorkingFileName(
gitUri.fsPath,
gitUri.repoPath,
gitUri.sha
);
if (fileName !== undefined) {
uri = Uri.file(repoPath !== undefined ? path.join(repoPath, fileName) : fileName);
}
}
return new HistoryNode(uri, repo, explorer);
if (UriComparer.equals(uri || gitUri, root && root.uri)) return root;
if (uri !== undefined) {
gitUri = await GitUri.fromUri(uri);
}
return new HistoryNode(gitUri, repo, explorer);
}
static setRenameFollowing(enabled: boolean) {

Loading…
取消
儲存