Browse Source

Changes to only expand repos w/ pending commits

main
Eric Amodio 4 years ago
parent
commit
a2f41be0e4
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/views/commitsView.ts

+ 5
- 2
src/views/commitsView.ts View File

@ -74,13 +74,16 @@ export class CommitsRepositoryNode extends SubscribeableViewNode {
this.splatted = false;
void this.ensureSubscription();
const branch = await this.repo.getBranch();
const item = new TreeItem(
this.repo.formattedName ?? this.uri.repoPath ?? '',
TreeItemCollapsibleState.Expanded,
(branch?.state.ahead ?? 0) > 0 || (branch?.state.behind ?? 0) > 0
? TreeItemCollapsibleState.Expanded
: TreeItemCollapsibleState.Collapsed,
);
item.contextValue = ContextValues.RepositoryFolder;
const branch = await this.repo.getBranch();
if (branch != null) {
const status = branch?.getTrackingStatus();
item.description = `${branch.name}${status ? ` ${GlyphChars.Dot} ${status}` : ''}`;

Loading…
Cancel
Save