Fix Ref::get_stored_hash() for reading the right header field
This commit is contained in:
parent
8a3d4fc0b2
commit
a6ca041903
1 changed files with 2 additions and 1 deletions
|
@ -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),
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue