Fixes error when there is no branches yet

This commit is contained in:
Eric Amodio
2017-03-28 01:26:53 -04:00
parent 9071b55026
commit ab417eadbe

View File

@@ -17,9 +17,10 @@ export class ShowQuickCurrentBranchHistoryCommand extends ActiveEditorCachedComm
} }
try { 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) { catch (ex) {
Logger.error(ex, 'ShowQuickCurrentBranchHistoryCommand'); Logger.error(ex, 'ShowQuickCurrentBranchHistoryCommand');