From 7e5d7bfe38548891aa014f3fe3ce1c0b501b20f8 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Mon, 6 Aug 2018 23:53:28 +1000 Subject: [PATCH] fix windows bash conditional error --- gitcommands.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gitcommands.go b/gitcommands.go index eabf23482..bf1a90026 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -178,10 +178,11 @@ func getGitBranches() []Branch { if branchCheck == "" { return append(branches, branchFromLine("master", 0)) } - rawString, _ := runDirectCommand(getBranchesCommand) - branchLines := splitLines(rawString) - for i, line := range branchLines { - branches = append(branches, branchFromLine(line, i)) + if rawString, err := runDirectCommand(getBranchesCommand); err == nil { + branchLines := splitLines(rawString) + for i, line := range branchLines { + branches = append(branches, branchFromLine(line, i)) + } } branches = getAndMergeFetchedBranches(branches) return branches