Add StoreId prefix removal

This commit is contained in:
Matthias Beyer 2016-07-29 16:19:14 +02:00
parent c1e430e1ff
commit be34dddf87

View file

@ -120,11 +120,12 @@ impl StoreIdAccessor for CreateHook {
.map_err(|e| e.into()) .map_err(|e| e.into())
}) })
.and_then(|(repo, cfg, sig, mut idx)| { .and_then(|(repo, cfg, sig, mut idx)| {
idx.add_path(id) id.strip_prefix(&self.storepath)
.map_err_into(GHEK::StoreIdStripError)
.and_then(|id| idx.add_path(&id).map_err_into(GHEK::RepositoryPathAddingError))
.map(|_| (repo, cfg, sig, idx)) .map(|_| (repo, cfg, sig, idx))
.map_err(|e| { debug!("[GIT CREATE HOOK]: Couldn't add Path"); e })
.map_err_into(GHEK::RepositoryPathAddingError)
.map_err_into(GHEK::RepositoryError) .map_err_into(GHEK::RepositoryError)
.map_err(|e| { debug!("[GIT CREATE HOOK]: Couldn't add Path: {:?}", e); e })
.map_err(|e| e.into()) .map_err(|e| e.into())
}) })
.and_then(|(repo, cfg, sig, mut idx)| { .and_then(|(repo, cfg, sig, mut idx)| {