diff --git a/pkg/config/user_config_validation.go b/pkg/config/user_config_validation.go index 5d43c4a28..fc504fe32 100644 --- a/pkg/config/user_config_validation.go +++ b/pkg/config/user_config_validation.go @@ -31,6 +31,14 @@ func (config *UserConfig) Validate() error { []string{"date", "alphabetical"}); err != nil { return err } + if err := validateEnum("git.log.order", config.Git.Log.Order, + []string{"date-order", "author-date-order", "topo-order", "default"}); err != nil { + return err + } + if err := validateEnum("git.log.showGraph", config.Git.Log.ShowGraph, + []string{"always", "never", "when-maximised"}); err != nil { + return err + } if err := validateKeybindings(config.Keybinding); err != nil { return err } diff --git a/pkg/config/user_config_validation_test.go b/pkg/config/user_config_validation_test.go index 67ff16991..fcbfe1139 100644 --- a/pkg/config/user_config_validation_test.go +++ b/pkg/config/user_config_validation_test.go @@ -82,6 +82,35 @@ func TestUserConfigValidate_enums(t *testing.T) { {value: "invalid_value", valid: false}, }, }, + { + name: "Git.Log.Order", + setup: func(config *UserConfig, value string) { + config.Git.Log.Order = value + }, + testCases: []testCase{ + {value: "date-order", valid: true}, + {value: "author-date-order", valid: true}, + {value: "topo-order", valid: true}, + {value: "default", valid: true}, + + {value: "", valid: false}, + {value: "invalid_value", valid: false}, + }, + }, + { + name: "Git.Log.ShowGraph", + setup: func(config *UserConfig, value string) { + config.Git.Log.ShowGraph = value + }, + testCases: []testCase{ + {value: "always", valid: true}, + {value: "never", valid: true}, + {value: "when-maximised", valid: true}, + + {value: "", valid: false}, + {value: "invalid_value", valid: false}, + }, + }, { name: "Keybindings", setup: func(config *UserConfig, value string) {