From 975a5315b036b84e0d8befd7ca5e7dbc062caf84 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 19 Jul 2019 04:00:02 +0200 Subject: Simplified code a bit --- pkg/commands/git.go | 6 ++---- pkg/gui/theme.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index fa1a73157..3bda46ee3 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -906,10 +906,8 @@ func (c *GitCommand) DiscardOldFileChanges(commits []*Commit, commitIndex int, f if err := c.StageFile(fileName); err != nil { return err } - } else { - if err := c.CheckoutFile("HEAD^", fileName); err != nil { - return err - } + } else if err := c.CheckoutFile("HEAD^", fileName); err != nil { + return err } // amend the commit diff --git a/pkg/gui/theme.go b/pkg/gui/theme.go index dbc8b904b..1f87e325e 100644 --- a/pkg/gui/theme.go +++ b/pkg/gui/theme.go @@ -31,7 +31,7 @@ func (gui *Gui) GetAttribute(key string) gocui.Attribute { func (gui *Gui) GetColor(keys []string) gocui.Attribute { var attribute gocui.Attribute for _, key := range keys { - attribute = attribute | gui.GetAttribute(key) + attribute |= gui.GetAttribute(key) } return attribute } -- cgit v1.2.3