Fix Ref::get_stored_hash() for reading the right header field

This commit is contained in:
Matthias Beyer 2016-09-05 14:19:37 +02:00
parent 8a3d4fc0b2
commit a6ca041903

View file

@ -239,7 +239,8 @@ impl<'a> Ref<'a> {
/// Get the hash of the link target which is stored in the ref object /// Get the hash of the link target which is stored in the ref object
pub fn get_stored_hash(&self) -> Result<String> { pub fn get_stored_hash(&self) -> Result<String> {
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... // content hash stored...
Ok(Some(Value::String(s))) => Ok(s), Ok(Some(Value::String(s))) => Ok(s),