From a6ca041903aef5b3c91dab00797a2f25a28eab68 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 5 Sep 2016 14:19:37 +0200 Subject: [PATCH] Fix Ref::get_stored_hash() for reading the right header field --- libimagref/src/reference.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs index 3fed6680..571312bf 100644 --- a/libimagref/src/reference.rs +++ b/libimagref/src/reference.rs @@ -239,7 +239,8 @@ impl<'a> Ref<'a> { /// Get the hash of the link target which is stored in the ref object pub fn get_stored_hash(&self) -> Result { - match self.0.get_header().read("ref.content_hash") { + let hasher_name = DefaultHasher::new().hash_name(); + match self.0.get_header().read(&format!("ref.content_hash.{}", hasher_name)[..]) { // content hash stored... Ok(Some(Value::String(s))) => Ok(s),