Small worktree scan style fixes (#36104)

Part of https://github.com/zed-industries/zed/issues/35780

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-08-13 14:29:53 +03:00 committed by GitHub
parent 81474a3de0
commit 8d63312eca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 24 deletions

View file

@ -10,7 +10,7 @@ use git::{
},
status::{FileStatus, GitStatus, StatusCode, TrackedStatus, UnmergedStatus},
};
use gpui::{AsyncApp, BackgroundExecutor, SharedString};
use gpui::{AsyncApp, BackgroundExecutor, SharedString, Task};
use ignore::gitignore::GitignoreBuilder;
use rope::Rope;
use smol::future::FutureExt as _;
@ -183,7 +183,7 @@ impl GitRepository for FakeGitRepository {
async move { None }.boxed()
}
fn status(&self, path_prefixes: &[RepoPath]) -> BoxFuture<'_, Result<GitStatus>> {
fn status(&self, path_prefixes: &[RepoPath]) -> Task<Result<GitStatus>> {
let workdir_path = self.dot_git_path.parent().unwrap();
// Load gitignores
@ -311,7 +311,10 @@ impl GitRepository for FakeGitRepository {
entries: entries.into(),
})
});
async move { result? }.boxed()
Task::ready(match result {
Ok(result) => result,
Err(e) => Err(e),
})
}
fn branches(&self) -> BoxFuture<'_, Result<Vec<Branch>>> {