This commit is contained in:
Mikayla Maki 2023-05-10 20:09:37 -07:00
parent f5c633e80c
commit adfbbf21b2
No known key found for this signature in database
3 changed files with 18 additions and 9 deletions

View file

@ -1606,10 +1606,15 @@ impl Database {
while let Some(db_status_entry) = db_repository_statuses.next().await {
let db_status_entry = db_status_entry?;
if db_status_entry.is_deleted {
repository.removed_worktree_repo_paths.push(db_status_entry.repo_path);
repository
.removed_worktree_repo_paths
.push(db_status_entry.repo_path);
} else {
repository.updated_worktree_statuses.push(proto::StatusEntry {
repo_path: db_status_entry.repo_path, status: db_status_entry.status as i32
repository
.updated_worktree_statuses
.push(proto::StatusEntry {
repo_path: db_status_entry.repo_path,
status: db_status_entry.status as i32,
});
}
}

View file

@ -14,6 +14,7 @@ use gpui::{executor::Deterministic, ModelHandle, Task, TestAppContext};
use language::{range_to_lsp, FakeLspAdapter, Language, LanguageConfig, PointUtf16};
use lsp::FakeLanguageServer;
use parking_lot::Mutex;
use pretty_assertions::assert_eq;
use project::{search::SearchQuery, Project, ProjectPath};
use rand::{
distributions::{Alphanumeric, DistString},
@ -32,7 +33,6 @@ use std::{
},
};
use util::ResultExt;
use pretty_assertions::assert_eq;
lazy_static::lazy_static! {
static ref PLAN_LOAD_PATH: Option<PathBuf> = path_env_var("LOAD_PLAN");
@ -828,7 +828,8 @@ async fn apply_client_operation(
let dot_git_dir = repo_path.join(".git");
let statuses = statuses.iter()
let statuses = statuses
.iter()
.map(|(path, val)| (path.as_path(), val.clone()))
.collect::<Vec<_>>();
@ -836,8 +837,11 @@ async fn apply_client_operation(
client.fs.create_dir(&dot_git_dir).await?;
}
client.fs.set_status_for_repo(&dot_git_dir, statuses.as_slice()).await;
},
client
.fs
.set_status_for_repo(&dot_git_dir, statuses.as_slice())
.await;
}
},
}
Ok(())

View file

@ -1,7 +1,7 @@
use anyhow::Result;
use collections::HashMap;
use parking_lot::Mutex;
use serde_derive::{Serialize, Deserialize};
use serde_derive::{Deserialize, Serialize};
use std::{
ffi::OsStr,
os::unix::prelude::OsStrExt,