From 58b95a9e89b5f60fb15d0e64ddce0850db313a4a Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 28 Nov 2017 11:48:07 -0500 Subject: [PATCH] Adds message when branch has no commits --- src/views/branchHistoryNode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/branchHistoryNode.ts b/src/views/branchHistoryNode.ts index 7d2161c..4cb1554 100644 --- a/src/views/branchHistoryNode.ts +++ b/src/views/branchHistoryNode.ts @@ -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 { 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) {