Browse Source

Adds message when branch has no commits

main
Eric Amodio 7 years ago
parent
commit
58b95a9e89
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/views/branchHistoryNode.ts

+ 2
- 2
src/views/branchHistoryNode.ts View File

@ -3,7 +3,7 @@ import { Iterables } from '../system';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitNode } from './commitNode';
import { GlyphChars } from '../constants';
import { ExplorerNode, ResourceType, ShowAllNode } from './explorerNode';
import { ExplorerNode, MessageNode, ResourceType, ShowAllNode } from './explorerNode';
import { GitExplorer } from './gitExplorer';
import { GitBranch, GitUri } from '../gitService';
@ -21,7 +21,7 @@ export class BranchHistoryNode extends ExplorerNode {
async getChildren(): Promise<ExplorerNode[]> {
const log = await this.explorer.git.getLogForRepo(this.uri.repoPath!, this.branch.name, this.maxCount);
if (log === undefined) return [];
if (log === undefined) return [new MessageNode('No commits yet')];
const children: (CommitNode | ShowAllNode)[] = [...Iterables.map(log.commits.values(), c => new CommitNode(c, this.explorer, this.branch))];
if (log.truncated) {

Loading…
Cancel
Save