remove unused deps

This commit is contained in:
Nikita Galaiko 2023-04-14 15:40:35 +02:00
parent 0b3ad99a7c
commit 807d68bc38
3 changed files with 31 additions and 25 deletions

1
src-tauri/Cargo.lock generated
View File

@ -1320,7 +1320,6 @@ dependencies = [
"timed", "timed",
"tokio", "tokio",
"tokio-tungstenite", "tokio-tungstenite",
"tokio-util",
"urlencoding", "urlencoding",
"uuid 1.3.0", "uuid 1.3.0",
"walkdir", "walkdir",

View File

@ -46,7 +46,6 @@ futures = "0.3"
futures-util = "0.3.8" futures-util = "0.3.8"
timed = "0.2.1" timed = "0.2.1"
serde-jsonlines = "0.4.0" serde-jsonlines = "0.4.0"
tokio-util = "0.7.7"
crossbeam-channel = "0.5.8" crossbeam-channel = "0.5.8"
[features] [features]

View File

@ -24,12 +24,15 @@ impl Repository {
project_store: projects::Storage, project_store: projects::Storage,
) -> Result<Self> { ) -> Result<Self> {
let path = root.as_ref().join(project_id.clone()); let path = root.as_ref().join(project_id.clone());
let git_repository = if path.exists() { if path.exists() {
git2::Repository::open(path.clone()) Ok(Self {
.with_context(|| format!("{}: failed to open git repository", path.display()))? project_id,
git_repository: git2::Repository::open(path.clone()).with_context(|| {
format!("{}: failed to open git repository", path.display())
})?,
project_store,
})
} else { } else {
// TODO: flush first session instead
let git_repository = git2::Repository::init_opts( let git_repository = git2::Repository::init_opts(
&path, &path,
&git2::RepositoryInitOptions::new() &git2::RepositoryInitOptions::new()
@ -38,6 +41,8 @@ impl Repository {
) )
.with_context(|| format!("{}: failed to initialize git repository", path.display()))?; .with_context(|| format!("{}: failed to initialize git repository", path.display()))?;
{
// TODO: remove this once flushing is fully working
let mut index = git_repository.index()?; let mut index = git_repository.index()?;
let oid = index.write_tree()?; let oid = index.write_tree()?;
let signature = git2::Signature::now("gitbutler", "gitbutler@localhost").unwrap(); let signature = git2::Signature::now("gitbutler", "gitbutler@localhost").unwrap();
@ -49,14 +54,17 @@ impl Repository {
&git_repository.find_tree(oid)?, &git_repository.find_tree(oid)?,
&[], &[],
)?; )?;
}
git_repository let gb_repository = Self {
};
Ok(Self {
project_id, project_id,
git_repository, git_repository,
project_store, project_store,
}) };
gb_repository.flush()?;
Ok(gb_repository)
}
} }
fn create_current_session( fn create_current_session(