diff --git a/lib/src/repo.rs b/lib/src/repo.rs index a6836b59a..344b35724 100644 --- a/lib/src/repo.rs +++ b/lib/src/repo.rs @@ -183,8 +183,8 @@ impl ReadonlyRepo { IndexFile::init(repo_path.join("index")); let evolution = ReadonlyEvolution::new(static_lifetime_repo); + Arc::get_mut(&mut repo).unwrap().evolution = Some(evolution); - ReadonlyRepo::init_cycles(&mut repo, evolution); repo.working_copy_locked() .check_out(checkout_commit) .expect("failed to check out root commit"); @@ -237,15 +237,10 @@ impl ReadonlyRepo { let repo_ref: &ReadonlyRepo = repo.as_ref(); let static_lifetime_repo: &'static ReadonlyRepo = unsafe { std::mem::transmute(repo_ref) }; let evolution = ReadonlyEvolution::new(static_lifetime_repo); - ReadonlyRepo::init_cycles(&mut repo, evolution); + Arc::get_mut(&mut repo).unwrap().evolution = Some(evolution); Ok(repo) } - fn init_cycles(mut repo: &mut Arc, evolution: ReadonlyEvolution<'static>) { - let mut repo_ref_mut = Arc::get_mut(&mut repo).unwrap(); - repo_ref_mut.evolution = Some(evolution); - } - pub fn repo_path(&self) -> &PathBuf { &self.repo_path }