Rename weak
to visible
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
a3c8892252
commit
68cfce1fb8
12 changed files with 95 additions and 96 deletions
|
@ -761,7 +761,7 @@ mod tests {
|
||||||
|
|
||||||
project
|
project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/test", false, cx)
|
project.find_or_create_local_worktree("/test", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -8217,7 +8217,7 @@ mod tests {
|
||||||
|
|
||||||
let (worktree, relative_path) = project
|
let (worktree, relative_path) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/file", false, cx)
|
project.find_or_create_local_worktree("/file", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -448,7 +448,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root", false, cx)
|
project.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -517,7 +517,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir", false, cx)
|
project.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -583,7 +583,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root/the-parent-dir/the-file", false, cx)
|
project.find_or_create_local_worktree("/root/the-parent-dir/the-file", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -485,10 +485,10 @@ impl Project {
|
||||||
) -> impl 'a + Iterator<Item = ModelHandle<Worktree>> {
|
) -> impl 'a + Iterator<Item = ModelHandle<Worktree>> {
|
||||||
self.worktrees.iter().filter_map(|worktree| {
|
self.worktrees.iter().filter_map(|worktree| {
|
||||||
worktree.upgrade(cx).and_then(|worktree| {
|
worktree.upgrade(cx).and_then(|worktree| {
|
||||||
if worktree.read(cx).is_weak() {
|
if worktree.read(cx).is_visible() {
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(worktree)
|
Some(worktree)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -589,7 +589,7 @@ impl Project {
|
||||||
for worktree_handle in this.worktrees.iter_mut() {
|
for worktree_handle in this.worktrees.iter_mut() {
|
||||||
match worktree_handle {
|
match worktree_handle {
|
||||||
WorktreeHandle::Strong(worktree) => {
|
WorktreeHandle::Strong(worktree) => {
|
||||||
if worktree.read(cx).is_weak() {
|
if !worktree.read(cx).is_visible() {
|
||||||
*worktree_handle = WorktreeHandle::Weak(worktree.downgrade());
|
*worktree_handle = WorktreeHandle::Weak(worktree.downgrade());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -768,7 +768,7 @@ impl Project {
|
||||||
} else {
|
} else {
|
||||||
let worktree = this
|
let worktree = this
|
||||||
.update(&mut cx, |this, cx| {
|
.update(&mut cx, |this, cx| {
|
||||||
this.create_local_worktree(&abs_path, true, cx)
|
this.create_local_worktree(&abs_path, false, cx)
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
this.update(&mut cx, |this, cx| {
|
this.update(&mut cx, |this, cx| {
|
||||||
|
@ -793,7 +793,7 @@ impl Project {
|
||||||
abs_path: PathBuf,
|
abs_path: PathBuf,
|
||||||
cx: &mut ModelContext<Project>,
|
cx: &mut ModelContext<Project>,
|
||||||
) -> Task<Result<()>> {
|
) -> Task<Result<()>> {
|
||||||
let worktree_task = self.find_or_create_local_worktree(&abs_path, false, cx);
|
let worktree_task = self.find_or_create_local_worktree(&abs_path, true, cx);
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
let (worktree, path) = worktree_task.await?;
|
let (worktree, path) = worktree_task.await?;
|
||||||
worktree
|
worktree
|
||||||
|
@ -2301,14 +2301,14 @@ impl Project {
|
||||||
pub fn find_or_create_local_worktree(
|
pub fn find_or_create_local_worktree(
|
||||||
&self,
|
&self,
|
||||||
abs_path: impl AsRef<Path>,
|
abs_path: impl AsRef<Path>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
cx: &mut ModelContext<Self>,
|
cx: &mut ModelContext<Self>,
|
||||||
) -> Task<Result<(ModelHandle<Worktree>, PathBuf)>> {
|
) -> Task<Result<(ModelHandle<Worktree>, PathBuf)>> {
|
||||||
let abs_path = abs_path.as_ref();
|
let abs_path = abs_path.as_ref();
|
||||||
if let Some((tree, relative_path)) = self.find_local_worktree(abs_path, cx) {
|
if let Some((tree, relative_path)) = self.find_local_worktree(abs_path, cx) {
|
||||||
Task::ready(Ok((tree.clone(), relative_path.into())))
|
Task::ready(Ok((tree.clone(), relative_path.into())))
|
||||||
} else {
|
} else {
|
||||||
let worktree = self.create_local_worktree(abs_path, weak, cx);
|
let worktree = self.create_local_worktree(abs_path, visible, cx);
|
||||||
cx.foreground()
|
cx.foreground()
|
||||||
.spawn(async move { Ok((worktree.await?, PathBuf::new())) })
|
.spawn(async move { Ok((worktree.await?, PathBuf::new())) })
|
||||||
}
|
}
|
||||||
|
@ -2341,14 +2341,14 @@ impl Project {
|
||||||
fn create_local_worktree(
|
fn create_local_worktree(
|
||||||
&self,
|
&self,
|
||||||
abs_path: impl AsRef<Path>,
|
abs_path: impl AsRef<Path>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
cx: &mut ModelContext<Self>,
|
cx: &mut ModelContext<Self>,
|
||||||
) -> Task<Result<ModelHandle<Worktree>>> {
|
) -> Task<Result<ModelHandle<Worktree>>> {
|
||||||
let fs = self.fs.clone();
|
let fs = self.fs.clone();
|
||||||
let client = self.client.clone();
|
let client = self.client.clone();
|
||||||
let path = Arc::from(abs_path.as_ref());
|
let path = Arc::from(abs_path.as_ref());
|
||||||
cx.spawn(|project, mut cx| async move {
|
cx.spawn(|project, mut cx| async move {
|
||||||
let worktree = Worktree::local(client.clone(), path, weak, fs, &mut cx).await?;
|
let worktree = Worktree::local(client.clone(), path, visible, fs, &mut cx).await?;
|
||||||
|
|
||||||
let (remote_project_id, is_shared) = project.update(&mut cx, |project, cx| {
|
let (remote_project_id, is_shared) = project.update(&mut cx, |project, cx| {
|
||||||
project.add_worktree(&worktree, cx);
|
project.add_worktree(&worktree, cx);
|
||||||
|
@ -2394,7 +2394,7 @@ impl Project {
|
||||||
|
|
||||||
let push_strong_handle = {
|
let push_strong_handle = {
|
||||||
let worktree = worktree.read(cx);
|
let worktree = worktree.read(cx);
|
||||||
self.is_shared() || worktree.is_remote()
|
self.is_shared() || worktree.is_visible() || worktree.is_remote()
|
||||||
};
|
};
|
||||||
if push_strong_handle {
|
if push_strong_handle {
|
||||||
self.worktrees
|
self.worktrees
|
||||||
|
@ -2627,7 +2627,7 @@ impl Project {
|
||||||
root_name: envelope.payload.root_name,
|
root_name: envelope.payload.root_name,
|
||||||
entries: Default::default(),
|
entries: Default::default(),
|
||||||
diagnostic_summaries: Default::default(),
|
diagnostic_summaries: Default::default(),
|
||||||
weak: envelope.payload.weak,
|
visible: envelope.payload.visible,
|
||||||
};
|
};
|
||||||
let (worktree, load_task) =
|
let (worktree, load_task) =
|
||||||
Worktree::remote(remote_id, replica_id, worktree, client, cx);
|
Worktree::remote(remote_id, replica_id, worktree, client, cx);
|
||||||
|
@ -3361,7 +3361,7 @@ impl Project {
|
||||||
) -> impl 'a + Future<Output = Vec<PathMatch>> {
|
) -> impl 'a + Future<Output = Vec<PathMatch>> {
|
||||||
let worktrees = self
|
let worktrees = self
|
||||||
.worktrees(cx)
|
.worktrees(cx)
|
||||||
.filter(|worktree| !worktree.read(cx).is_weak())
|
.filter(|worktree| worktree.read(cx).is_visible())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
let include_root_name = worktrees.len() > 1;
|
let include_root_name = worktrees.len() > 1;
|
||||||
let candidate_sets = worktrees
|
let candidate_sets = worktrees
|
||||||
|
@ -3656,7 +3656,7 @@ mod tests {
|
||||||
|
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree(&root_link_path, false, cx)
|
project.find_or_create_local_worktree(&root_link_path, true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3725,7 +3725,7 @@ mod tests {
|
||||||
|
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir", false, cx)
|
project.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3823,7 +3823,7 @@ mod tests {
|
||||||
let project = Project::test(Arc::new(RealFs), cx);
|
let project = Project::test(Arc::new(RealFs), cx);
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree(&dir.path(), false, cx)
|
project.find_or_create_local_worktree(&dir.path(), true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3871,7 +3871,7 @@ mod tests {
|
||||||
|
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir/b.rs", false, cx)
|
project.find_or_create_local_worktree("/dir/b.rs", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3928,16 +3928,13 @@ mod tests {
|
||||||
assert_eq!(definition.range.to_offset(target_buffer), 9..10);
|
assert_eq!(definition.range.to_offset(target_buffer), 9..10);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
list_worktrees(&project, cx),
|
list_worktrees(&project, cx),
|
||||||
[("/dir/b.rs".as_ref(), false), ("/dir/a.rs".as_ref(), true)]
|
[("/dir/b.rs".as_ref(), true), ("/dir/a.rs".as_ref(), false)]
|
||||||
);
|
);
|
||||||
|
|
||||||
drop(definition);
|
drop(definition);
|
||||||
});
|
});
|
||||||
cx.read(|cx| {
|
cx.read(|cx| {
|
||||||
assert_eq!(
|
assert_eq!(list_worktrees(&project, cx), [("/dir/b.rs".as_ref(), true)]);
|
||||||
list_worktrees(&project, cx),
|
|
||||||
[("/dir/b.rs".as_ref(), false)]
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
fn list_worktrees<'a>(
|
fn list_worktrees<'a>(
|
||||||
|
@ -3951,7 +3948,7 @@ mod tests {
|
||||||
let worktree = worktree.read(cx);
|
let worktree = worktree.read(cx);
|
||||||
(
|
(
|
||||||
worktree.as_local().unwrap().abs_path().as_ref(),
|
worktree.as_local().unwrap().abs_path().as_ref(),
|
||||||
worktree.is_weak(),
|
worktree.is_visible(),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
@ -3972,7 +3969,7 @@ mod tests {
|
||||||
let project = Project::test(fs.clone(), cx);
|
let project = Project::test(fs.clone(), cx);
|
||||||
let worktree_id = project
|
let worktree_id = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir", false, cx)
|
p.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -4010,7 +4007,7 @@ mod tests {
|
||||||
let project = Project::test(fs.clone(), cx);
|
let project = Project::test(fs.clone(), cx);
|
||||||
let worktree_id = project
|
let worktree_id = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir/file1", false, cx)
|
p.find_or_create_local_worktree("/dir/file1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -4054,7 +4051,7 @@ mod tests {
|
||||||
|
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree(dir.path(), false, cx)
|
p.find_or_create_local_worktree(dir.path(), true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4091,7 +4088,7 @@ mod tests {
|
||||||
Worktree::remote(
|
Worktree::remote(
|
||||||
1,
|
1,
|
||||||
1,
|
1,
|
||||||
initial_snapshot.to_proto(&Default::default(), Default::default()),
|
initial_snapshot.to_proto(&Default::default(), true),
|
||||||
rpc.clone(),
|
rpc.clone(),
|
||||||
cx,
|
cx,
|
||||||
)
|
)
|
||||||
|
@ -4200,7 +4197,7 @@ mod tests {
|
||||||
let project = Project::test(fs.clone(), cx);
|
let project = Project::test(fs.clone(), cx);
|
||||||
let worktree_id = project
|
let worktree_id = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/the-dir", false, cx)
|
p.find_or_create_local_worktree("/the-dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -4250,7 +4247,7 @@ mod tests {
|
||||||
let project = Project::test(Arc::new(RealFs), cx);
|
let project = Project::test(Arc::new(RealFs), cx);
|
||||||
let (worktree, _) = project
|
let (worktree, _) = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree(dir.path(), false, cx)
|
p.find_or_create_local_worktree(dir.path(), true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4384,7 +4381,7 @@ mod tests {
|
||||||
let project = Project::test(Arc::new(RealFs), cx);
|
let project = Project::test(Arc::new(RealFs), cx);
|
||||||
let (worktree, _) = project
|
let (worktree, _) = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree(dir.path(), false, cx)
|
p.find_or_create_local_worktree(dir.path(), true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4493,7 +4490,7 @@ mod tests {
|
||||||
let project = Project::test(fs.clone(), cx);
|
let project = Project::test(fs.clone(), cx);
|
||||||
let (worktree, _) = project
|
let (worktree, _) = project
|
||||||
.update(cx, |p, cx| {
|
.update(cx, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/the-dir", false, cx)
|
p.find_or_create_local_worktree("/the-dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4761,7 +4758,7 @@ mod tests {
|
||||||
|
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir", false, cx)
|
project.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4889,7 +4886,7 @@ mod tests {
|
||||||
let project = Project::test(fs.clone(), cx);
|
let project = Project::test(fs.clone(), cx);
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir", false, cx)
|
project.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -71,7 +71,7 @@ pub struct LocalWorktree {
|
||||||
queued_operations: Vec<(u64, Operation)>,
|
queued_operations: Vec<(u64, Operation)>,
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct RemoteWorktree {
|
pub struct RemoteWorktree {
|
||||||
|
@ -83,7 +83,7 @@ pub struct RemoteWorktree {
|
||||||
replica_id: ReplicaId,
|
replica_id: ReplicaId,
|
||||||
queued_operations: Vec<(u64, Operation)>,
|
queued_operations: Vec<(u64, Operation)>,
|
||||||
diagnostic_summaries: TreeMap<PathKey, DiagnosticSummary>,
|
diagnostic_summaries: TreeMap<PathKey, DiagnosticSummary>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -169,11 +169,12 @@ impl Worktree {
|
||||||
pub async fn local(
|
pub async fn local(
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
path: impl Into<Arc<Path>>,
|
path: impl Into<Arc<Path>>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
cx: &mut AsyncAppContext,
|
cx: &mut AsyncAppContext,
|
||||||
) -> Result<ModelHandle<Self>> {
|
) -> Result<ModelHandle<Self>> {
|
||||||
let (tree, scan_states_tx) = LocalWorktree::new(client, path, weak, fs.clone(), cx).await?;
|
let (tree, scan_states_tx) =
|
||||||
|
LocalWorktree::new(client, path, visible, fs.clone(), cx).await?;
|
||||||
tree.update(cx, |tree, cx| {
|
tree.update(cx, |tree, cx| {
|
||||||
let tree = tree.as_local_mut().unwrap();
|
let tree = tree.as_local_mut().unwrap();
|
||||||
let abs_path = tree.abs_path().clone();
|
let abs_path = tree.abs_path().clone();
|
||||||
|
@ -203,7 +204,7 @@ impl Worktree {
|
||||||
.map(|c| c.to_ascii_lowercase())
|
.map(|c| c.to_ascii_lowercase())
|
||||||
.collect();
|
.collect();
|
||||||
let root_name = worktree.root_name.clone();
|
let root_name = worktree.root_name.clone();
|
||||||
let weak = worktree.weak;
|
let visible = worktree.visible;
|
||||||
let snapshot = Snapshot {
|
let snapshot = Snapshot {
|
||||||
id: WorktreeId(remote_id as usize),
|
id: WorktreeId(remote_id as usize),
|
||||||
root_name,
|
root_name,
|
||||||
|
@ -236,7 +237,7 @@ impl Worktree {
|
||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
weak,
|
visible,
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -356,10 +357,10 @@ impl Worktree {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_weak(&self) -> bool {
|
pub fn is_visible(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Worktree::Local(worktree) => worktree.weak,
|
Worktree::Local(worktree) => worktree.visible,
|
||||||
Worktree::Remote(worktree) => worktree.weak,
|
Worktree::Remote(worktree) => worktree.visible,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -458,7 +459,7 @@ impl LocalWorktree {
|
||||||
async fn new(
|
async fn new(
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
path: impl Into<Arc<Path>>,
|
path: impl Into<Arc<Path>>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
fs: Arc<dyn Fs>,
|
fs: Arc<dyn Fs>,
|
||||||
cx: &mut AsyncAppContext,
|
cx: &mut AsyncAppContext,
|
||||||
) -> Result<(ModelHandle<Worktree>, UnboundedSender<ScanState>)> {
|
) -> Result<(ModelHandle<Worktree>, UnboundedSender<ScanState>)> {
|
||||||
|
@ -525,7 +526,7 @@ impl LocalWorktree {
|
||||||
queued_operations: Default::default(),
|
queued_operations: Default::default(),
|
||||||
client,
|
client,
|
||||||
fs,
|
fs,
|
||||||
weak,
|
visible,
|
||||||
};
|
};
|
||||||
|
|
||||||
cx.spawn_weak(|this, mut cx| async move {
|
cx.spawn_weak(|this, mut cx| async move {
|
||||||
|
@ -738,7 +739,7 @@ impl LocalWorktree {
|
||||||
worktree_id: self.id().to_proto(),
|
worktree_id: self.id().to_proto(),
|
||||||
root_name: self.root_name().to_string(),
|
root_name: self.root_name().to_string(),
|
||||||
authorized_logins: self.authorized_logins(),
|
authorized_logins: self.authorized_logins(),
|
||||||
weak: self.weak,
|
visible: self.visible,
|
||||||
};
|
};
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
let response = client.request(register_message).await;
|
let response = client.request(register_message).await;
|
||||||
|
@ -1028,7 +1029,7 @@ impl LocalSnapshot {
|
||||||
pub(crate) fn to_proto(
|
pub(crate) fn to_proto(
|
||||||
&self,
|
&self,
|
||||||
diagnostic_summaries: &TreeMap<PathKey, DiagnosticSummary>,
|
diagnostic_summaries: &TreeMap<PathKey, DiagnosticSummary>,
|
||||||
weak: bool,
|
visible: bool,
|
||||||
) -> proto::Worktree {
|
) -> proto::Worktree {
|
||||||
let root_name = self.root_name.clone();
|
let root_name = self.root_name.clone();
|
||||||
proto::Worktree {
|
proto::Worktree {
|
||||||
|
@ -1044,7 +1045,7 @@ impl LocalSnapshot {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(path, summary)| summary.to_proto(&path.0))
|
.map(|(path, summary)| summary.to_proto(&path.0))
|
||||||
.collect(),
|
.collect(),
|
||||||
weak,
|
visible,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2468,7 +2469,7 @@ mod tests {
|
||||||
let tree = Worktree::local(
|
let tree = Worktree::local(
|
||||||
client,
|
client,
|
||||||
Arc::from(Path::new("/root")),
|
Arc::from(Path::new("/root")),
|
||||||
false,
|
true,
|
||||||
fs,
|
fs,
|
||||||
&mut cx.to_async(),
|
&mut cx.to_async(),
|
||||||
)
|
)
|
||||||
|
@ -2511,7 +2512,7 @@ mod tests {
|
||||||
let tree = Worktree::local(
|
let tree = Worktree::local(
|
||||||
client,
|
client,
|
||||||
dir.path(),
|
dir.path(),
|
||||||
false,
|
true,
|
||||||
Arc::new(RealFs),
|
Arc::new(RealFs),
|
||||||
&mut cx.to_async(),
|
&mut cx.to_async(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -327,7 +327,7 @@ impl ProjectPanel {
|
||||||
.project
|
.project
|
||||||
.read(cx)
|
.read(cx)
|
||||||
.worktrees(cx)
|
.worktrees(cx)
|
||||||
.filter(|worktree| !worktree.read(cx).is_weak());
|
.filter(|worktree| worktree.read(cx).is_visible());
|
||||||
self.visible_entries.clear();
|
self.visible_entries.clear();
|
||||||
|
|
||||||
let mut entry_ix = 0;
|
let mut entry_ix = 0;
|
||||||
|
@ -642,7 +642,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (root1, _) = project
|
let (root1, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root1", false, cx)
|
project.find_or_create_local_worktree("/root1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -651,7 +651,7 @@ mod tests {
|
||||||
.await;
|
.await;
|
||||||
let (root2, _) = project
|
let (root2, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root2", false, cx)
|
project.find_or_create_local_worktree("/root2", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -134,7 +134,7 @@ message RegisterWorktree {
|
||||||
uint64 worktree_id = 2;
|
uint64 worktree_id = 2;
|
||||||
string root_name = 3;
|
string root_name = 3;
|
||||||
repeated string authorized_logins = 4;
|
repeated string authorized_logins = 4;
|
||||||
bool weak = 5;
|
bool visible = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UnregisterWorktree {
|
message UnregisterWorktree {
|
||||||
|
@ -502,7 +502,7 @@ message Worktree {
|
||||||
string root_name = 2;
|
string root_name = 2;
|
||||||
repeated Entry entries = 3;
|
repeated Entry entries = 3;
|
||||||
repeated DiagnosticSummary diagnostic_summaries = 4;
|
repeated DiagnosticSummary diagnostic_summaries = 4;
|
||||||
bool weak = 5;
|
bool visible = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message File {
|
message File {
|
||||||
|
|
|
@ -735,7 +735,7 @@ mod tests {
|
||||||
let project = Project::test(fs.clone(), cx);
|
let project = Project::test(fs.clone(), cx);
|
||||||
let (tree, _) = project
|
let (tree, _) = project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir", false, cx)
|
project.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -351,7 +351,7 @@ impl Server {
|
||||||
.values()
|
.values()
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect(),
|
.collect(),
|
||||||
weak: worktree.weak,
|
visible: worktree.visible,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
@ -440,7 +440,7 @@ impl Server {
|
||||||
Worktree {
|
Worktree {
|
||||||
authorized_user_ids: contact_user_ids.clone(),
|
authorized_user_ids: contact_user_ids.clone(),
|
||||||
root_name: request.payload.root_name.clone(),
|
root_name: request.payload.root_name.clone(),
|
||||||
weak: request.payload.weak,
|
visible: request.payload.visible,
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
@ -1070,7 +1070,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1202,7 +1202,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1303,7 +1303,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1475,7 +1475,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir", false, cx)
|
p.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1557,7 +1557,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir", false, cx)
|
p.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1638,7 +1638,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir", false, cx)
|
p.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1717,7 +1717,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir", false, cx)
|
p.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1790,7 +1790,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -1878,7 +1878,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2104,7 +2104,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2303,7 +2303,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2409,7 +2409,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/root-1", false, cx)
|
p.find_or_create_local_worktree("/root-1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2545,7 +2545,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/root-1", false, cx)
|
p.find_or_create_local_worktree("/root-1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2666,7 +2666,7 @@ mod tests {
|
||||||
|
|
||||||
let (worktree_1, _) = project_a
|
let (worktree_1, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/root-1", false, cx)
|
p.find_or_create_local_worktree("/root-1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2675,7 +2675,7 @@ mod tests {
|
||||||
.await;
|
.await;
|
||||||
let (worktree_2, _) = project_a
|
let (worktree_2, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/root-2", false, cx)
|
p.find_or_create_local_worktree("/root-2", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2775,7 +2775,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/root-1", false, cx)
|
p.find_or_create_local_worktree("/root-1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -2921,7 +2921,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/code/crate-1", false, cx)
|
p.find_or_create_local_worktree("/code/crate-1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3051,7 +3051,7 @@ mod tests {
|
||||||
|
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/root", false, cx)
|
p.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3155,7 +3155,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -3391,7 +3391,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/dir", false, cx)
|
p.find_or_create_local_worktree("/dir", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4005,7 +4005,7 @@ mod tests {
|
||||||
});
|
});
|
||||||
let (worktree_a, _) = project_a
|
let (worktree_a, _) = project_a
|
||||||
.update(cx_a, |p, cx| {
|
.update(cx_a, |p, cx| {
|
||||||
p.find_or_create_local_worktree("/a", false, cx)
|
p.find_or_create_local_worktree("/a", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4165,7 +4165,7 @@ mod tests {
|
||||||
|
|
||||||
let (collab_worktree, _) = host_project
|
let (collab_worktree, _) = host_project
|
||||||
.update(&mut host_cx, |project, cx| {
|
.update(&mut host_cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/_collab", false, cx)
|
project.find_or_create_local_worktree("/_collab", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4662,7 +4662,7 @@ mod tests {
|
||||||
log::info!("Host: find/create local worktree {:?}", path);
|
log::info!("Host: find/create local worktree {:?}", path);
|
||||||
project
|
project
|
||||||
.update(&mut cx, |project, cx| {
|
.update(&mut cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree(path, false, cx)
|
project.find_or_create_local_worktree(path, true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -4674,7 +4674,7 @@ mod tests {
|
||||||
.update(&mut cx, |project, cx| {
|
.update(&mut cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree(
|
project.find_or_create_local_worktree(
|
||||||
file.clone(),
|
file.clone(),
|
||||||
false,
|
true,
|
||||||
cx,
|
cx,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -4769,7 +4769,8 @@ mod tests {
|
||||||
.worktrees(&cx)
|
.worktrees(&cx)
|
||||||
.filter(|worktree| {
|
.filter(|worktree| {
|
||||||
let worktree = worktree.read(cx);
|
let worktree = worktree.read(cx);
|
||||||
!worktree.is_weak() && worktree.entries(false).any(|e| e.is_file())
|
worktree.is_visible()
|
||||||
|
&& worktree.entries(false).any(|e| e.is_file())
|
||||||
})
|
})
|
||||||
.choose(&mut *rng.lock())
|
.choose(&mut *rng.lock())
|
||||||
}) {
|
}) {
|
||||||
|
|
|
@ -30,7 +30,7 @@ pub struct Project {
|
||||||
pub struct Worktree {
|
pub struct Worktree {
|
||||||
pub authorized_user_ids: Vec<UserId>,
|
pub authorized_user_ids: Vec<UserId>,
|
||||||
pub root_name: String,
|
pub root_name: String,
|
||||||
pub weak: bool,
|
pub visible: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
@ -204,7 +204,7 @@ impl Store {
|
||||||
let mut worktree_root_names = project
|
let mut worktree_root_names = project
|
||||||
.worktrees
|
.worktrees
|
||||||
.values()
|
.values()
|
||||||
.filter(|worktree| !worktree.weak)
|
.filter(|worktree| worktree.visible)
|
||||||
.map(|worktree| worktree.root_name.clone())
|
.map(|worktree| worktree.root_name.clone())
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
worktree_root_names.sort_unstable();
|
worktree_root_names.sort_unstable();
|
||||||
|
|
|
@ -737,7 +737,7 @@ impl Workspace {
|
||||||
cx: &mut ViewContext<Self>,
|
cx: &mut ViewContext<Self>,
|
||||||
) -> Task<Result<ProjectPath>> {
|
) -> Task<Result<ProjectPath>> {
|
||||||
let entry = self.project().update(cx, |project, cx| {
|
let entry = self.project().update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree(abs_path, false, cx)
|
project.find_or_create_local_worktree(abs_path, true, cx)
|
||||||
});
|
});
|
||||||
cx.spawn(|_, cx| async move {
|
cx.spawn(|_, cx| async move {
|
||||||
let (worktree, path) = entry.await?;
|
let (worktree, path) = entry.await?;
|
||||||
|
|
|
@ -257,7 +257,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root", false, cx)
|
project.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -370,7 +370,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/dir1", false, cx)
|
project.find_or_create_local_worktree("/dir1", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -445,7 +445,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root", false, cx)
|
project.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -492,7 +492,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root", false, cx)
|
project.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -644,7 +644,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root", false, cx)
|
project.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -707,7 +707,7 @@ mod tests {
|
||||||
params
|
params
|
||||||
.project
|
.project
|
||||||
.update(cx, |project, cx| {
|
.update(cx, |project, cx| {
|
||||||
project.find_or_create_local_worktree("/root", false, cx)
|
project.find_or_create_local_worktree("/root", true, cx)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue