Kaynağa Gözat

Fixes issue where changed files count was wrong when behind upstream

main
Eric Amodio 6 yıl önce
ebeveyn
işleme
9dbb25ac12
2 değiştirilmiş dosya ile 21 ekleme ve 4 silme
  1. +1
    -0
      CHANGELOG.md
  2. +20
    -4
      src/views/statusFilesNode.ts

+ 1
- 0
CHANGELOG.md Dosyayı Görüntüle

@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- 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
## [8.4.1] - 2018-06-19
### Fixed

+ 20
- 4
src/views/statusFilesNode.ts Dosyayı Görüntüle

@ -199,10 +199,26 @@ export class StatusFilesNode extends ExplorerNode {
async getTreeItem(): Promise<TreeItem> {
let files = this.status.files !== undefined && this.includeWorkingTree ? this.status.files.length : 0;
if (this.status.upstream !== undefined) {
const stats = await Container.git.getChangedFilesCount(this.repoPath, this.status.upstream);
if (stats !== undefined) {
files = stats.files;
if (this.status.upstream !== undefined && this.status.state.ahead > 0) {
if (files > 0) {
const aheadFiles = await Container.git.getDiffStatus(this.repoPath, `${this.status.upstream}...`);
if (aheadFiles !== undefined) {
const uniques = new Set();
for (const f of this.status.files) {
uniques.add(f.fileName);
}
for (const f of aheadFiles) {
uniques.add(f.fileName);
}
files = uniques.size;
}
}
else {
const stats = await Container.git.getChangedFilesCount(this.repoPath, `${this.status.upstream}...`);
if (stats !== undefined) {
files += stats.files;
}
}
}

Yükleniyor…
İptal
Kaydet