1use git2::{Error, ErrorClass, ErrorCode}; 2 3pub type GitResult<T = ()> = Result<T, Error>; 4 5pub fn runtime_error<T, S>(msg: S) -> GitResult<T> 6where 7 S: Into<String>, 8{ 9 Err(Error::new(ErrorCode::User, ErrorClass::Invalid, msg.into())) 10}