1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-03-05 15:15:49 +02:00

Simplified code a bit

This commit is contained in:
Christian Muehlhaeuser 2019-07-19 04:00:02 +02:00 committed by Jesse Duffield
parent 8f734b11e3
commit 975a5315b0
2 changed files with 3 additions and 5 deletions

View File

@ -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

View File

@ -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
}