mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
allow ignoring directories
This commit is contained in:
@ -31,7 +31,7 @@ func (c *GitCommand) StageAll() error {
|
||||
return c.OSCommand.RunCommand("git add -A")
|
||||
}
|
||||
|
||||
// UnstageAll stages all files
|
||||
// UnstageAll unstages all files
|
||||
func (c *GitCommand) UnstageAll() error {
|
||||
return c.OSCommand.RunCommand("git reset")
|
||||
}
|
||||
|
@ -144,13 +144,19 @@ func (s *StatusLineNode) sortChildren() {
|
||||
s.Children = sortedChildren
|
||||
}
|
||||
|
||||
// returns true if any descendant file is tracked
|
||||
func (s *StatusLineNode) GetIsTracked() bool {
|
||||
if s.File != nil {
|
||||
return s.File.GetIsTracked()
|
||||
}
|
||||
|
||||
// pretty sure I'm allowed to do this
|
||||
return true
|
||||
for _, child := range s.Children {
|
||||
if child.GetIsTracked() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *StatusLineNode) GetPath() string {
|
||||
@ -211,3 +217,19 @@ func (s *StatusLineNode) ID() string {
|
||||
func (s *StatusLineNode) Description() string {
|
||||
return s.GetPath()
|
||||
}
|
||||
|
||||
func (s *StatusLineNode) ForEachFile(cb func(*File) error) error {
|
||||
if s.File != nil {
|
||||
if err := cb(s.File); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
for _, child := range s.Children {
|
||||
if err := child.ForEachFile(cb); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user