From aa2534c9019004b84a92552873d12445fc63dc6c Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 18:00:24 -0300 Subject: [PATCH] fix: handle disabled digest outputs properly Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/meta_plugin/digest.rs | 25 +++++++++++-------------- src/modes/status.rs | 6 ++++++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/meta_plugin/digest.rs b/src/meta_plugin/digest.rs index 49c1f91..bcee2f6 100644 --- a/src/meta_plugin/digest.rs +++ b/src/meta_plugin/digest.rs @@ -175,20 +175,17 @@ impl MetaPlugin for DigestMetaPlugin { metadata.push(meta_data); } - // Set unused outputs to None - let unused_outputs: Vec<&str> = match hasher { - Hasher::Md5(_) => vec!["digest_sha256", "digest_sha512"], - Hasher::Sha256(_) => vec!["digest_md5", "digest_sha512"], - Hasher::Sha512(_) => vec!["digest_md5", "digest_sha256"], - }; - - for output_name in unused_outputs { - if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( - output_name, - serde_yaml::Value::Null, - &self.outputs - ) { - metadata.push(meta_data); + // Set all other digest outputs to None + let all_outputs = vec!["digest_md5", "digest_sha256", "digest_sha512"]; + for output_name in all_outputs { + if output_name != hasher.output_name() { + if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( + output_name, + serde_yaml::Value::Null, + &self.outputs + ) { + metadata.push(meta_data); + } } } } diff --git a/src/modes/status.rs b/src/modes/status.rs index 9bae1d6..1f02a02 100644 --- a/src/modes/status.rs +++ b/src/modes/status.rs @@ -245,6 +245,12 @@ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option {} } } + // For digest plugin, check if the output is None (disabled) + else if plugin_config.name == "digest" { + if value.is_null() { + continue; + } + } // Convert serde_yaml::Value to a string representation let value_str = match value {