1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

more file tree improvements

This commit is contained in:
Jesse Duffield
2021-03-20 13:49:43 +11:00
parent cd0532b4d6
commit c27cea6f30
4 changed files with 29 additions and 47 deletions

View File

@ -142,16 +142,8 @@ func (c *GitCommand) DiscardAllFileChanges(file *models.File) error {
}
func (c *GitCommand) DiscardAllDirChanges(node *models.StatusLineNode) error {
if err := c.RemoveUntrackedDirFiles(node); err != nil {
return err
}
quotedPath := c.OSCommand.Quote(node.GetPath())
if err := c.OSCommand.RunCommand("git checkout HEAD -- %s", quotedPath); err != nil {
return err
}
return nil
// this could be more efficient but we would need to handle all the edge cases
return node.ForEachFile(c.DiscardAllFileChanges)
}
func (c *GitCommand) DiscardUnstagedDirChanges(node *models.StatusLineNode) error {