summaryrefslogtreecommitdiffstats
path: root/libimagref
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-09-05 14:17:55 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-09-05 16:15:40 +0200
commit8a3d4fc0b204607c73785a0b5a6d036054125ddd (patch)
tree3af4e71404f547e8c9031747c6755723368000c5 /libimagref
parent6a1ffe059b418ed8838c193e01d83ebaafcacb63 (diff)
Fix Ref::update_ref() to set the appropriate header field
Diffstat (limited to 'libimagref')
-rw-r--r--libimagref/src/reference.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/libimagref/src/reference.rs b/libimagref/src/reference.rs
index ba01f341..3fed6680 100644
--- a/libimagref/src/reference.rs
+++ b/libimagref/src/reference.rs
@@ -352,7 +352,7 @@ impl<'a> Ref<'a> {
/// Update the Ref by re-checking the file from FS
/// This errors if the file is not present or cannot be read()
pub fn update_ref(&mut self) -> Result<()> {
- let current_hash = try!(self.get_current_hash());
+ let current_hash = try!(self.get_current_hash()); // uses the default hasher
let current_perm = try!(self.get_current_permissions());
try!(self.0
@@ -362,9 +362,11 @@ impl<'a> Ref<'a> {
.map_err(|e| REK::StoreWriteError.into_error_with_cause(e))
);
+ let hasher_name = DefaultHasher::new().hash_name();
+
try!(self.0
.get_header_mut()
- .set("ref.content_hash", Value::String(current_hash))
+ .set(&format!("ref.content_hash.{}", hasher_name)[..], Value::String(current_hash))
.map_err(Box::new)
.map_err(|e| REK::StoreWriteError.into_error_with_cause(e))
);