From 27f0802443742bb8a05e9e99f6c21eabb17b2e9b Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Sun, 12 May 2024 02:59:53 +0200 Subject: [PATCH] remove gb_reference from projects --- crates/gitbutler-core/src/projects/controller.rs | 12 +----------- crates/gitbutler-tauri/src/main.rs | 1 - 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/crates/gitbutler-core/src/projects/controller.rs b/crates/gitbutler-core/src/projects/controller.rs index dc9a769d6..fda03d94b 100644 --- a/crates/gitbutler-core/src/projects/controller.rs +++ b/crates/gitbutler-core/src/projects/controller.rs @@ -7,7 +7,7 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use super::{storage, storage::UpdateRequest, Project, ProjectId}; -use crate::{error, gb_repository, project_repository, users}; +use crate::{error, project_repository}; use crate::{ error::{AnyhowContextExt, Code, Error, ErrorWithContext}, projects::AuthKey, @@ -25,7 +25,6 @@ pub trait Watchers { pub struct Controller { local_data_dir: PathBuf, projects_storage: storage::Storage, - users: users::Controller, watchers: Option>, } @@ -33,13 +32,11 @@ impl Controller { pub fn new( local_data_dir: PathBuf, projects_storage: storage::Storage, - users: users::Controller, watchers: Option, ) -> Self { Self { local_data_dir, projects_storage, - users, watchers: watchers.map(|w| Arc::new(w) as Arc<_>), } } @@ -48,7 +45,6 @@ impl Controller { let path = path.into(); Self { projects_storage: storage::Storage::from_path(&path), - users: users::Controller::from_path(&path), local_data_dir: path, watchers: None, } @@ -103,12 +99,6 @@ impl Controller { ..Default::default() }; - // create all required directories to avoid racing later - let user = self.users.get_user()?; - let project_repository = project_repository::Repository::open(&project)?; - gb_repository::Repository::open(&self.local_data_dir, &project_repository, user.as_ref()) - .context("failed to open repository")?; - self.projects_storage .add(&project) .context("failed to add project to storage")?; diff --git a/crates/gitbutler-tauri/src/main.rs b/crates/gitbutler-tauri/src/main.rs index a231180aa..a9ddae74c 100644 --- a/crates/gitbutler-tauri/src/main.rs +++ b/crates/gitbutler-tauri/src/main.rs @@ -106,7 +106,6 @@ fn main() { let projects_controller = gitbutler_core::projects::Controller::new( app_data_dir.clone(), projects_storage_controller.clone(), - users_controller.clone(), Some(watcher_controller.clone()) ); app_handle.manage(projects_controller.clone());