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 <mail@beyermatthias.de>
This commit is contained in:
parent
22c239c212
commit
04e006154c
1 changed files with 5 additions and 5 deletions
|
@ -174,12 +174,12 @@ impl<'a, H: Hasher> Ref for RefWithHasher<'a, H> {
|
||||||
fn get_path(&self) -> Result<PathBuf> {
|
fn get_path(&self) -> Result<PathBuf> {
|
||||||
self.0
|
self.0
|
||||||
.get_header()
|
.get_header()
|
||||||
.read("ref.path")
|
.read("ref.relpath")
|
||||||
.map_err(Error::from)?
|
.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| {
|
.and_then(|v| {
|
||||||
v.as_str()
|
v.as_str()
|
||||||
.ok_or_else(|| EM::EntryHeaderTypeError2("ref.path", "string"))
|
.ok_or_else(|| EM::EntryHeaderTypeError2("ref.relpath", "string"))
|
||||||
.map_err(Error::from)
|
.map_err(Error::from)
|
||||||
})
|
})
|
||||||
.map(PathBuf::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.<hash>", "string")))?;
|
.ok_or_else(|| Error::from(EM::EntryHeaderTypeError2("ref.hash.<hash>", "string")))?;
|
||||||
|
|
||||||
let path = ref_header
|
let path = ref_header
|
||||||
.read("path")
|
.read("relpath")
|
||||||
.map_err(Error::from)?
|
.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()
|
.as_str()
|
||||||
.map(PathBuf::from)
|
.map(PathBuf::from)
|
||||||
.ok_or_else(|| Error::from(EM::EntryHeaderTypeError2("ref.hash.<hash>", "string")))?;
|
.ok_or_else(|| Error::from(EM::EntryHeaderTypeError2("ref.hash.<hash>", "string")))?;
|
||||||
|
|
Loading…
Reference in a new issue