Skip to content

Commit a7b8c24

Browse files
committed
Fixes refresh of stashes and remotes
1 parent 95f590f commit a7b8c24

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
1010

1111
### Fixed
1212
- Fixes issue where failed git commands would get stuck in the pending queue causing future similar commands to also fail
13+
- Fixes issue where changes to git remotes would refresh the entire `GitLens` view
1314

1415
## [6.0.0] - 2017-11-08
1516

src/views/repositoryNode.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,24 @@ export class RepositoryNode extends ExplorerNode {
6363
private onRepoChanged(e: RepositoryChangeEvent) {
6464
Logger.log(`RepositoryNode.onRepoChanged(${e.changes.join()}); triggering node refresh`);
6565

66-
let node: ExplorerNode | undefined;
67-
if (this.children !== undefined && e.changed(RepositoryChange.Stashes, true)) {
68-
node = this.children.find(c => c instanceof StashesNode);
66+
if (this.children === undefined || e.changed(RepositoryChange.Repository) || e.changed(RepositoryChange.Config)) {
67+
this.explorer.refreshNode(this);
68+
69+
return;
70+
}
71+
72+
if (e.changed(RepositoryChange.Stashes)) {
73+
const node = this.children.find(c => c instanceof StashesNode);
74+
if (node !== undefined) {
75+
this.explorer.refreshNode(node);
76+
}
6977
}
7078

71-
this.explorer.refreshNode(node || this);
79+
if (e.changed(RepositoryChange.Remotes)) {
80+
const node = this.children.find(c => c instanceof RemotesNode);
81+
if (node !== undefined) {
82+
this.explorer.refreshNode(node);
83+
}
84+
}
7285
}
7386
}

0 commit comments

Comments
 (0)