From ab417eadbe6ff7c0ae02b996885f9d15c6c17a65 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 28 Mar 2017 01:26:53 -0400 Subject: [PATCH] Fixes error when there is no branches yet --- src/commands/showQuickCurrentBranchHistory.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/showQuickCurrentBranchHistory.ts b/src/commands/showQuickCurrentBranchHistory.ts index ad5775e..d69c843 100644 --- a/src/commands/showQuickCurrentBranchHistory.ts +++ b/src/commands/showQuickCurrentBranchHistory.ts @@ -17,9 +17,10 @@ export class ShowQuickCurrentBranchHistoryCommand extends ActiveEditorCachedComm } try { - const branch = (await this.git.getBranch(this.git.repoPath)).name; + const branch = await this.git.getBranch(this.git.repoPath); + if (!branch) return undefined; - return commands.executeCommand(Commands.ShowQuickBranchHistory, uri, branch, undefined, goBackCommand); + return commands.executeCommand(Commands.ShowQuickBranchHistory, uri, branch.name, undefined, goBackCommand); } catch (ex) { Logger.error(ex, 'ShowQuickCurrentBranchHistoryCommand');