use std::time::{Duration, SystemTime, UNIX_EPOCH};
use endringer_core::types::{CommitId, ObjectId};
pub(crate) fn seconds_to_systemtime(seconds: i64) -> SystemTime {
if seconds >= 0 {
UNIX_EPOCH + Duration::from_secs(seconds as u64)
} else {
UNIX_EPOCH
}
}
pub(crate) fn gix_id_to_commit_id(id: gix::ObjectId) -> CommitId {
CommitId::from_bytes(id.as_slice().to_vec())
}
#[allow(dead_code)]
pub(crate) fn gix_id_to_object_id(id: gix::ObjectId) -> ObjectId {
ObjectId::from_bytes(id.as_slice().to_vec())
}