// use actix::prelude::*; use crate as actor; use git_next_git as git; impl Handler for actor::RepoActor { type Result = (); #[tracing::instrument(name = "RepoActor::CloneRepo", skip_all, fields(repo = %self.repo_details /*, gitdir = %self.repo_details.gitdir */))] fn handle( &mut self, _msg: actor::messages::CloneRepo, ctx: &mut Self::Context, ) -> Self::Result { actor::logger(&self.log, "Handler: CloneRepo: start"); tracing::debug!("Handler: CloneRepo: start"); let gitdir = self.repo_details.gitdir.clone(); match git::repository::open(&*self.repository_factory, &self.repo_details, gitdir) { Ok(repository) => { actor::logger(&self.log, "open okay"); tracing::debug!("open okay"); self.open_repository.replace(repository); if self.repo_details.repo_config.is_none() { actor::do_send( ctx.address(), actor::messages::LoadConfigFromRepo, &self.log, ); } else { actor::do_send( ctx.address(), actor::messages::ValidateRepo::new(self.message_token), &self.log, ); } } Err(err) => { actor::logger(&self.log, "open failed"); tracing::debug!("err: {err:?}"); tracing::warn!("Could not open repo: {err}") } } tracing::debug!("Handler: CloneRepo: finish"); } }