diff options
Diffstat (limited to 'pkg/commands/git_commands/working_tree.go')
-rw-r--r-- | pkg/commands/git_commands/working_tree.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/commands/git_commands/working_tree.go b/pkg/commands/git_commands/working_tree.go index f594a639b..08e247459 100644 --- a/pkg/commands/git_commands/working_tree.go +++ b/pkg/commands/git_commands/working_tree.go @@ -8,6 +8,7 @@ import ( "time" "github.com/go-errors/errors" + "github.com/jesseduffield/generics/slices" "github.com/jesseduffield/lazygit/pkg/commands/loaders" "github.com/jesseduffield/lazygit/pkg/commands/models" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" @@ -46,10 +47,9 @@ func (self *WorkingTreeCommands) StageFile(path string) error { } func (self *WorkingTreeCommands) StageFiles(paths []string) error { - quotedPaths := make([]string, len(paths)) - for i, path := range paths { - quotedPaths[i] = self.cmd.Quote(path) - } + quotedPaths := slices.Map(paths, func(path string) string { + return self.cmd.Quote(path) + }) return self.cmd.New(fmt.Sprintf("git add -- %s", strings.Join(quotedPaths, " "))).Run() } |