mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Simplified code a bit
This commit is contained in:
committed by
Jesse Duffield
parent
8f734b11e3
commit
975a5315b0
@ -906,11 +906,9 @@ func (c *GitCommand) DiscardOldFileChanges(commits []*Commit, commitIndex int, f
|
|||||||
if err := c.StageFile(fileName); err != nil {
|
if err := c.StageFile(fileName); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else if err := c.CheckoutFile("HEAD^", fileName); err != nil {
|
||||||
if err := c.CheckoutFile("HEAD^", fileName); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// amend the commit
|
// amend the commit
|
||||||
cmd, err = c.AmendHead()
|
cmd, err = c.AmendHead()
|
||||||
|
@ -31,7 +31,7 @@ func (gui *Gui) GetAttribute(key string) gocui.Attribute {
|
|||||||
func (gui *Gui) GetColor(keys []string) gocui.Attribute {
|
func (gui *Gui) GetColor(keys []string) gocui.Attribute {
|
||||||
var attribute gocui.Attribute
|
var attribute gocui.Attribute
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
attribute = attribute | gui.GetAttribute(key)
|
attribute |= gui.GetAttribute(key)
|
||||||
}
|
}
|
||||||
return attribute
|
return attribute
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user