From d013b60fc18e5c0adcf6f3790d25b51c78d481b8 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 17:42:55 -0300 Subject: [PATCH] feat: set unused digest outputs to null based on method Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/meta_plugin/digest.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/meta_plugin/digest.rs b/src/meta_plugin/digest.rs index 939155e..fb917a5 100644 --- a/src/meta_plugin/digest.rs +++ b/src/meta_plugin/digest.rs @@ -166,6 +166,7 @@ impl MetaPlugin for DigestMetaPlugin { let hash_value = hasher.finalize(); let output_name = hasher.output_name(); + // Add the selected hash output if let Some(meta_data) = crate::meta_plugin::process_metadata_outputs( output_name, hash_value, @@ -173,6 +174,23 @@ 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); + } + } } self.is_finalized = true;