소스 검색

Fixes issue where file history wasn't auto updated

main
Eric Amodio 6 년 전
부모
커밋
d81f4f4339
2개의 변경된 파일21개의 추가작업 그리고 3개의 파일을 삭제
  1. +1
    -0
      CHANGELOG.md
  2. +20
    -3
      src/views/fileHistoryNode.ts

+ 1
- 0
CHANGELOG.md 파일 보기

@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Fixes [#436](https://github.com/eamodio/vscode-gitlens/issues/436) - Copy to clipboard not working
- Fixes [#442](https://github.com/eamodio/vscode-gitlens/issues/442) - GitLens File History fails if name (or path) starts with -
- Fixes issue where changed files count was wrong when the branch was behind the upstream
- Fixes issue where the *GitLens File History* explorer wasn't being updated automatically for working changes
## [8.4.1] - 2018-06-19
### Fixed

+ 20
- 3
src/views/fileHistoryNode.ts 파일 보기

@ -1,6 +1,6 @@
'use strict';
import { Iterables } from '../system';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode';
import { Container } from '../container';
import { Explorer, ExplorerNode, MessageNode, ResourceType } from './explorerNode';
@ -11,7 +11,8 @@ import {
GitUri,
Repository,
RepositoryChange,
RepositoryChangeEvent
RepositoryChangeEvent,
RepositoryFileSystemChangeEvent
} from '../gitService';
import { Logger } from '../logger';
@ -99,7 +100,15 @@ export class FileHistoryNode extends ExplorerNode {
}
private updateSubscription() {
this.disposable = this.disposable || this.repo.onDidChange(this.onRepoChanged, this);
if (this.disposable) return;
this.disposable = Disposable.from(
this.repo.onDidChange(this.onRepoChanged, this),
this.repo.onDidChangeFileSystem(this.onRepoFileSystemChanged, this),
{ dispose: () => this.repo.stopWatchingFileSystem() }
);
this.repo.startWatchingFileSystem();
}
private onRepoChanged(e: RepositoryChangeEvent) {
@ -109,4 +118,12 @@ export class FileHistoryNode extends ExplorerNode {
this.explorer.refreshNode(this);
}
private onRepoFileSystemChanged(e: RepositoryFileSystemChangeEvent) {
if (!e.uris.some(uri => uri.toString() === this.uri.toString())) return;
Logger.log(`FileHistoryNode.onRepoFileSystemChanged; triggering node refresh`);
this.explorer.refreshNode(this);
}
}

불러오는 중...
취소
저장