44 "bytes"
55 "embed"
66 "fmt"
7+ "maps"
78 "os"
89 "os/exec"
910 "path/filepath"
@@ -26,9 +27,9 @@ type Config struct {
2627
2728// FilterConfig holds diff filtering configuration.
2829type FilterConfig struct {
29- MaxFileLines int `toml:"max_file_lines"` // Max lines per file (0 = use default)
30- DefaultExcludePatterns []string `toml:"default_exclude_patterns"` // Override built-in defaults
31- ExcludePatterns []string `toml:"exclude_patterns"` // Additional patterns to exclude
30+ MaxFileLines int `toml:"max_file_lines"` // Max lines per file (0 = use default)
31+ DefaultExcludePatterns []string `toml:"default_exclude_patterns"` // Override built-in defaults
32+ ExcludePatterns []string `toml:"exclude_patterns"` // Additional patterns to exclude
3233}
3334
3435// rawConfig is the TOML structure used to detect mutual exclusivity in a single layer.
@@ -134,9 +135,7 @@ func Load() (Config, error) {
134135 if cfg .Engines == nil {
135136 cfg .Engines = map [string ]EngineConfig {}
136137 }
137- for name , ec := range repoCfg .Engines {
138- cfg .Engines [name ] = ec
139- }
138+ maps .Copy (cfg .Engines , repoCfg .Engines )
140139 }
141140 // Merge filter config from repo
142141 if repoCfg .Filter .MaxFileLines != 0 {
@@ -196,9 +195,7 @@ func loadConfigLayer(data []byte, cfg *Config, source string) error {
196195 if cfg .Engines == nil {
197196 cfg .Engines = map [string ]EngineConfig {}
198197 }
199- for name , ec := range raw .Engines {
200- cfg .Engines [name ] = ec
201- }
198+ maps .Copy (cfg .Engines , raw .Engines )
202199 }
203200 // Merge filter config
204201 if raw .Filter .MaxFileLines != 0 {
0 commit comments