Make GitRepository::status async and remove cx parameter (#27514)

This lays the groundwork for using `status` as part of the new agent
panel.

Release Notes:

- N/A
This commit is contained in:
Antonio Scandurra 2025-03-27 10:05:54 +01:00 committed by GitHub
parent 926d10cc45
commit 7354ef91e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 662 additions and 716 deletions

View file

@ -351,7 +351,7 @@ async fn test_renaming_case_only(cx: &mut TestAppContext) {
const OLD_NAME: &str = "aaa.rs";
const NEW_NAME: &str = "AAA.rs";
let fs = Arc::new(RealFs::default());
let fs = Arc::new(RealFs::new(None, cx.executor()));
let temp_root = TempTree::new(json!({
OLD_NAME: "",
}));
@ -876,7 +876,7 @@ async fn test_write_file(cx: &mut TestAppContext) {
let worktree = Worktree::local(
dir.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -965,7 +965,7 @@ async fn test_file_scan_inclusions(cx: &mut TestAppContext) {
let tree = Worktree::local(
dir.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -1028,7 +1028,7 @@ async fn test_file_scan_exclusions_overrules_inclusions(cx: &mut TestAppContext)
let tree = Worktree::local(
dir.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -1085,7 +1085,7 @@ async fn test_file_scan_inclusions_reindexes_on_setting_change(cx: &mut TestAppC
let tree = Worktree::local(
dir.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -1166,7 +1166,7 @@ async fn test_file_scan_exclusions(cx: &mut TestAppContext) {
let tree = Worktree::local(
dir.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -1271,7 +1271,7 @@ async fn test_fs_events_in_exclusions(cx: &mut TestAppContext) {
let tree = Worktree::local(
dir.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -1382,7 +1382,7 @@ async fn test_fs_events_in_dot_git_worktree(cx: &mut TestAppContext) {
let tree = Worktree::local(
dot_git_worktree_dir.clone(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -1512,7 +1512,7 @@ async fn test_create_dir_all_on_create_entry(cx: &mut TestAppContext) {
assert!(tree.entry_for_path("a/b/").unwrap().is_dir());
});
let fs_real = Arc::new(RealFs::default());
let fs_real = Arc::new(RealFs::new(None, cx.executor()));
let temp_root = TempTree::new(json!({
"a": {}
}));
@ -2126,7 +2126,7 @@ async fn test_rename_work_directory(cx: &mut TestAppContext) {
let tree = Worktree::local(
root_path,
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -2233,7 +2233,7 @@ async fn test_file_status(cx: &mut TestAppContext) {
let tree = Worktree::local(
root.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -2422,7 +2422,7 @@ async fn test_git_repository_status(cx: &mut TestAppContext) {
let tree = Worktree::local(
root.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -2551,7 +2551,7 @@ async fn test_git_status_postprocessing(cx: &mut TestAppContext) {
let tree = Worktree::local(
root.path(),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -2619,7 +2619,7 @@ async fn test_repository_subfolder_git_status(cx: &mut TestAppContext) {
let tree = Worktree::local(
root.path().join(project_root),
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)
@ -2685,7 +2685,7 @@ async fn test_conflicted_cherry_pick(cx: &mut TestAppContext) {
let tree = Worktree::local(
root_path,
true,
Arc::new(RealFs::default()),
Arc::new(RealFs::new(None, cx.executor())),
Default::default(),
&mut cx.to_async(),
)