Add Runtime::new_committer_sig()

This commit is contained in:
Matthias Beyer 2016-07-22 15:38:43 +02:00
parent e0a390d840
commit 9d9338d0e4

View file

@ -92,6 +92,15 @@ impl<'a> Runtime<'a> {
})
}
pub fn new_committer_sig(&self) -> Option<Result<Signature>> {
self.committer
.as_ref()
.map(|c| {
Signature::now(c.name, c.mail)
.map_err(|e| GHEK::MkSignature.into_error_with_cause(Box::new(e)))
})
}
pub fn repository(&self) -> Result<&Repository> {
self.repository.as_ref().ok_or(GHEK::MkRepo.into_error())
}