mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 02:26:14 +03:00
remove unused deps
This commit is contained in:
parent
0b3ad99a7c
commit
807d68bc38
1
src-tauri/Cargo.lock
generated
1
src-tauri/Cargo.lock
generated
@ -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",
|
||||||
|
@ -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]
|
||||||
|
@ -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,25 +41,30 @@ impl Repository {
|
|||||||
)
|
)
|
||||||
.with_context(|| format!("{}: failed to initialize git repository", path.display()))?;
|
.with_context(|| format!("{}: failed to initialize git repository", path.display()))?;
|
||||||
|
|
||||||
let mut index = git_repository.index()?;
|
{
|
||||||
let oid = index.write_tree()?;
|
// TODO: remove this once flushing is fully working
|
||||||
let signature = git2::Signature::now("gitbutler", "gitbutler@localhost").unwrap();
|
let mut index = git_repository.index()?;
|
||||||
git_repository.commit(
|
let oid = index.write_tree()?;
|
||||||
Some("HEAD"),
|
let signature = git2::Signature::now("gitbutler", "gitbutler@localhost").unwrap();
|
||||||
&signature,
|
git_repository.commit(
|
||||||
&signature,
|
Some("HEAD"),
|
||||||
"Initial commit",
|
&signature,
|
||||||
&git_repository.find_tree(oid)?,
|
&signature,
|
||||||
&[],
|
"Initial commit",
|
||||||
)?;
|
&git_repository.find_tree(oid)?,
|
||||||
|
&[],
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
git_repository
|
let gb_repository = Self {
|
||||||
};
|
project_id,
|
||||||
Ok(Self {
|
git_repository,
|
||||||
project_id,
|
project_store,
|
||||||
git_repository,
|
};
|
||||||
project_store,
|
|
||||||
})
|
gb_repository.flush()?;
|
||||||
|
Ok(gb_repository)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_current_session(
|
fn create_current_session(
|
||||||
|
Loading…
Reference in New Issue
Block a user