mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-25 16:09:44 +00:00
Be clearer about using GitFilesIncluded setting
This commit is contained in:
parent
01176e04b7
commit
9427bb7553
1 changed files with 19 additions and 20 deletions
|
@ -673,28 +673,27 @@ impl LocalWorktree {
|
||||||
cx.spawn(|this, mut cx| async move {
|
cx.spawn(|this, mut cx| async move {
|
||||||
let text = fs.load(&abs_path).await?;
|
let text = fs.load(&abs_path).await?;
|
||||||
|
|
||||||
let head_text = if matches!(
|
let head_text = match files_included {
|
||||||
files_included,
|
settings::GitFilesIncluded::All | settings::GitFilesIncluded::OnlyTracked => {
|
||||||
settings::GitFilesIncluded::All | settings::GitFilesIncluded::OnlyTracked
|
let results = if let Some(repo) = snapshot.repo_for(&abs_path) {
|
||||||
) {
|
cx.background()
|
||||||
let results = if let Some(repo) = snapshot.repo_for(&abs_path) {
|
.spawn({
|
||||||
cx.background()
|
let path = path.clone();
|
||||||
.spawn({
|
async move { repo.repo.lock().load_head_text(&path) }
|
||||||
let path = path.clone();
|
})
|
||||||
async move { repo.repo.lock().load_head_text(&path) }
|
.await
|
||||||
})
|
} else {
|
||||||
.await
|
None
|
||||||
} else {
|
};
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
if files_included == settings::GitFilesIncluded::All {
|
if files_included == settings::GitFilesIncluded::All {
|
||||||
results.or_else(|| Some(text.clone()))
|
results.or_else(|| Some(text.clone()))
|
||||||
} else {
|
} else {
|
||||||
results
|
results
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
None
|
settings::GitFilesIncluded::None => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Eagerly populate the snapshot with an updated entry for the loaded file
|
// Eagerly populate the snapshot with an updated entry for the loaded file
|
||||||
|
|
Loading…
Reference in a new issue