From 60cf549a3285531047009d9cf8cbb58c86a8e488 Mon Sep 17 00:00:00 2001 From: Anthony HAMON Date: Tue, 18 Sep 2018 09:23:41 +0200 Subject: [PATCH] commands/git : reverse the logic --- pkg/commands/git.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index cca406d9a..a106d8dce 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -484,12 +484,13 @@ func (c *GitCommand) GetCommits() []Commit { func (c *GitCommand) GetLog() string { // currently limiting to 30 for performance reasons // TODO: add lazyloading when you scroll down - if result, err := c.OSCommand.RunCommandWithOutput("git log --oneline -30"); err == nil { - return result + result, err := c.OSCommand.RunCommandWithOutput("git log --oneline -30") + if err != nil { + // assume if there is an error there are no commits yet for this branch + return "" } - // assume if there is an error there are no commits yet for this branch - return "" + return result } // Ignore adds a file to the gitignore for the repo