From 04e006154c01c262ca96c2450ab16d6441339f35 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 19 Feb 2019 21:49:14 +0100 Subject: [PATCH] Fix: Use "ref.relpath" as path to header value The header value for the relative path is at "ref.relpath". This fixes the wrong selector. Signed-off-by: Matthias Beyer --- lib/entry/libimagentryref/src/reference.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/entry/libimagentryref/src/reference.rs b/lib/entry/libimagentryref/src/reference.rs index 96a13530..bcb7ba66 100644 --- a/lib/entry/libimagentryref/src/reference.rs +++ b/lib/entry/libimagentryref/src/reference.rs @@ -174,12 +174,12 @@ impl<'a, H: Hasher> Ref for RefWithHasher<'a, H> { fn get_path(&self) -> Result { self.0 .get_header() - .read("ref.path") + .read("ref.relpath") .map_err(Error::from)? - .ok_or_else(|| Error::from(EM::EntryHeaderFieldMissing("ref.path"))) + .ok_or_else(|| Error::from(EM::EntryHeaderFieldMissing("ref.relpath"))) .and_then(|v| { v.as_str() - .ok_or_else(|| EM::EntryHeaderTypeError2("ref.path", "string")) + .ok_or_else(|| EM::EntryHeaderTypeError2("ref.relpath", "string")) .map_err(Error::from) }) .map(PathBuf::from) @@ -199,9 +199,9 @@ impl<'a, H: Hasher> Ref for RefWithHasher<'a, H> { .ok_or_else(|| Error::from(EM::EntryHeaderTypeError2("ref.hash.", "string")))?; let path = ref_header - .read("path") + .read("relpath") .map_err(Error::from)? - .ok_or_else(|| err_msg("Header missing at 'ref.path'"))? + .ok_or_else(|| err_msg("Header missing at 'ref.relpath'"))? .as_str() .map(PathBuf::from) .ok_or_else(|| Error::from(EM::EntryHeaderTypeError2("ref.hash.", "string")))?;