Skip to content

Commit 58b95a9

Browse files
committed
Adds message when branch has no commits
1 parent 79a6dbd commit 58b95a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/views/branchHistoryNode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Iterables } from '../system';
33
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
44
import { CommitNode } from './commitNode';
55
import { GlyphChars } from '../constants';
6-
import { ExplorerNode, ResourceType, ShowAllNode } from './explorerNode';
6+
import { ExplorerNode, MessageNode, ResourceType, ShowAllNode } from './explorerNode';
77
import { GitExplorer } from './gitExplorer';
88
import { GitBranch, GitUri } from '../gitService';
99

@@ -21,7 +21,7 @@ export class BranchHistoryNode extends ExplorerNode {
2121

2222
async getChildren(): Promise<ExplorerNode[]> {
2323
const log = await this.explorer.git.getLogForRepo(this.uri.repoPath!, this.branch.name, this.maxCount);
24-
if (log === undefined) return [];
24+
if (log === undefined) return [new MessageNode('No commits yet')];
2525

2626
const children: (CommitNode | ShowAllNode)[] = [...Iterables.map(log.commits.values(), c => new CommitNode(c, this.explorer, this.branch))];
2727
if (log.truncated) {

0 commit comments

Comments
 (0)