diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 936dcb64a..d68620867 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -196,10 +196,14 @@ func loadUserConfig(configFiles []*ConfigFile, base *UserConfig) (*UserConfig, e return nil, err } + existingCustomCommands := base.CustomCommands + if err := yaml.Unmarshal(content, base); err != nil { return nil, fmt.Errorf("The config at `%s` couldn't be parsed, please inspect it before opening up an issue.\n%w", path, err) } + base.CustomCommands = append(base.CustomCommands, existingCustomCommands...) + if err := base.Validate(); err != nil { return nil, fmt.Errorf("The config at `%s` has a validation error.\n%w", path, err) } diff --git a/pkg/integration/tests/config/custom_commands_in_per_repo_config.go b/pkg/integration/tests/config/custom_commands_in_per_repo_config.go index 4cff322ef..81f8724aa 100644 --- a/pkg/integration/tests/config/custom_commands_in_per_repo_config.go +++ b/pkg/integration/tests/config/custom_commands_in_per_repo_config.go @@ -49,10 +49,7 @@ customCommands: t.Views().Status().Content(Contains("other → master")) t.GlobalPress("X") - /* EXPECTED: t.FileSystem().FileContent("../other/file.txt", Equals("global X")) - ACTUAL: */ - t.FileSystem().PathNotPresent("../other/file.txt") t.GlobalPress("Y") t.FileSystem().FileContent("../other/file.txt", Equals("local Y"))