From 9d9338d0e425f8b1117434351db826426b509065 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 22 Jul 2016 15:38:43 +0200 Subject: [PATCH] Add Runtime::new_committer_sig() --- libimagstorestdhook/src/vcs/git/runtime.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libimagstorestdhook/src/vcs/git/runtime.rs b/libimagstorestdhook/src/vcs/git/runtime.rs index f32551e8..39fa2d8f 100644 --- a/libimagstorestdhook/src/vcs/git/runtime.rs +++ b/libimagstorestdhook/src/vcs/git/runtime.rs @@ -92,6 +92,15 @@ impl<'a> Runtime<'a> { }) } + pub fn new_committer_sig(&self) -> Option> { + 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()) }