diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 7d42ee22d2..a6407c4066 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -58,7 +58,6 @@ use jj_lib::backend::MergedTreeId; use jj_lib::backend::TreeValue; use jj_lib::commit::Commit; use jj_lib::config::ConfigError; -use jj_lib::config::ConfigNamePathBuf; use jj_lib::config::ConfigSource; use jj_lib::conflicts::ConflictMarkerStyle; use jj_lib::file_util; @@ -149,9 +148,7 @@ use crate::commit_templater::CommitTemplateLanguage; use crate::commit_templater::CommitTemplateLanguageExtension; use crate::complete; use crate::config::new_config_path; -use crate::config::AnnotatedValue; use crate::config::CommandNameAndArgs; -use crate::config::ConfigEnvError; use crate::config::LayeredConfigs; use crate::diff_util; use crate::diff_util::DiffFormat; @@ -319,11 +316,9 @@ impl CommandHelper { &self.data.settings } - pub fn resolved_config_values( - &self, - prefix: &ConfigNamePathBuf, - ) -> Result, ConfigEnvError> { - self.data.layered_configs.resolved_config_values(prefix) + // TODO: will be moved to UserSettings + pub fn layered_configs(&self) -> &LayeredConfigs { + &self.data.layered_configs } pub fn revset_extensions(&self) -> &Arc { diff --git a/cli/src/commands/config/list.rs b/cli/src/commands/config/list.rs index 2458443133..4cd8ceccae 100644 --- a/cli/src/commands/config/list.rs +++ b/cli/src/commands/config/list.rs @@ -78,7 +78,10 @@ pub fn cmd_config_list( let mut formatter = ui.stdout_formatter(); let name_path = args.name.clone().unwrap_or_else(ConfigNamePathBuf::root); let mut wrote_values = false; - for annotated in command.resolved_config_values(&name_path)? { + for annotated in command + .layered_configs() + .resolved_config_values(&name_path)? + { // Remove overridden values. if annotated.is_overridden && !args.include_overridden { continue;