diff --git a/Cargo.lock b/Cargo.lock index 3b186a2893c53702d19d6f1f5cb1d5edc4aeb660..1544ef8302da558c1153e81434b1deae1217feae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5652,6 +5652,7 @@ version = "0.1.0" dependencies = [ "anyhow", "client", + "clock", "gpui", "language", "log", diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 76aec72e907022c60312e3ab8cf858f950065ee8..34e2e477046efce005ae783f520fca8eed84d20f 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -130,6 +130,27 @@ impl Project { } else { None }; + + if let Some(project_id) = remote_id { + let mut registrations = Vec::new(); + this.read_with(&cx, |this, cx| { + for worktree in &this.worktrees { + let worktree_id = worktree.id() as u64; + let worktree = worktree.read(cx).as_local().unwrap(); + registrations.push(rpc.request( + proto::RegisterWorktree { + project_id, + worktree_id, + root_name: worktree.root_name().to_string(), + authorized_logins: worktree.authorized_logins(), + }, + )); + } + }); + for registration in registrations { + registration.await?; + } + } this.update(&mut cx, |this, cx| this.set_remote_id(remote_id, cx)); } }