mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Stage only tracked files when staging all in filter-by-tracked-files view
Also, fix two other commands that stage all files under the hood: - when continuing a rebase after resolving conflicts, we auto-stage all files, but in this case we never want to include untracked files, regardless of the filter - likewise, pressing ctrl-f to find a base commit for fixup stages all files for convenience, but again, this should only stage files that are already tracked
This commit is contained in:
@ -49,8 +49,10 @@ func (self *WorkingTreeCommands) StageFiles(paths []string, extraArgs []string)
|
||||
}
|
||||
|
||||
// StageAll stages all files
|
||||
func (self *WorkingTreeCommands) StageAll() error {
|
||||
cmdArgs := NewGitCmd("add").Arg("-A").ToArgv()
|
||||
func (self *WorkingTreeCommands) StageAll(onlyTrackedFiles bool) error {
|
||||
cmdArgs := NewGitCmd("add").
|
||||
ArgIfElse(onlyTrackedFiles, "-u", "-A").
|
||||
ToArgv()
|
||||
|
||||
return self.cmd.New(cmdArgs).Run()
|
||||
}
|
||||
|
Reference in New Issue
Block a user