mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +00:00
Remove the CORRECT, overly agressive deletion codepath
This commit is contained in:
parent
adfbbf21b2
commit
191ac86f09
1 changed files with 20 additions and 19 deletions
|
@ -2477,6 +2477,26 @@ impl Database {
|
|||
.exec(&*tx)
|
||||
.await?;
|
||||
}
|
||||
if !repository.removed_worktree_repo_paths.is_empty() {
|
||||
worktree_repository_statuses::Entity::update_many()
|
||||
.filter(
|
||||
worktree_repository_statuses::Column::ProjectId
|
||||
.eq(project_id)
|
||||
.and(worktree_repository_statuses::Column::WorktreeId.eq(worktree_id))
|
||||
.and(worktree_repository_statuses::Column::WorkDirectoryId.eq(repository.work_directory_id as i64))
|
||||
.and(
|
||||
worktree_repository_statuses::Column::RepoPath
|
||||
.is_in(repository.removed_worktree_repo_paths.iter().map(String::as_str)),
|
||||
),
|
||||
)
|
||||
.set(worktree_repository_statuses::ActiveModel {
|
||||
is_deleted: ActiveValue::Set(true),
|
||||
scan_id: ActiveValue::Set(update.scan_id as i64),
|
||||
..Default::default()
|
||||
})
|
||||
.exec(&*tx)
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2498,25 +2518,6 @@ impl Database {
|
|||
})
|
||||
.exec(&*tx)
|
||||
.await?;
|
||||
|
||||
// Flip all status entries associated with a given repository_entry
|
||||
worktree_repository_statuses::Entity::update_many()
|
||||
.filter(
|
||||
worktree_repository_statuses::Column::ProjectId
|
||||
.eq(project_id)
|
||||
.and(worktree_repository_statuses::Column::WorktreeId.eq(worktree_id))
|
||||
.and(
|
||||
worktree_repository_statuses::Column::WorkDirectoryId
|
||||
.is_in(update.removed_repositories.iter().map(|id| *id as i64)),
|
||||
),
|
||||
)
|
||||
.set(worktree_repository_statuses::ActiveModel {
|
||||
is_deleted: ActiveValue::Set(true),
|
||||
scan_id: ActiveValue::Set(update.scan_id as i64),
|
||||
..Default::default()
|
||||
})
|
||||
.exec(&*tx)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let connection_ids = self.project_guest_connection_ids(project_id, &tx).await?;
|
||||
|
|
Loading…
Reference in a new issue