mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Build again
This commit is contained in:
parent
7e5d49487b
commit
bf3b3da6ed
3 changed files with 8 additions and 9 deletions
|
@ -662,10 +662,9 @@ impl Buffer {
|
|||
self.file = Some(new_file);
|
||||
task
|
||||
}
|
||||
|
||||
|
||||
pub fn update_git(&mut self, cx: &mut ModelContext<Self>) {
|
||||
//Grab head text
|
||||
|
||||
|
||||
self.git_diff_recalc(cx);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use git2::{Repository as LibGitRepository, RepositoryOpenFlags as LibGitRepositoryOpenFlags};
|
||||
use parking_lot::Mutex;
|
||||
use std::{path::Path, sync::Arc, ffi::OsStr};
|
||||
use std::{ffi::OsStr, path::Path, sync::Arc};
|
||||
use util::ResultExt;
|
||||
|
||||
#[derive(Clone)]
|
||||
|
|
|
@ -636,6 +636,7 @@ impl LocalWorktree {
|
|||
let path = Arc::from(path);
|
||||
let abs_path = self.absolutize(&path);
|
||||
let fs = self.fs.clone();
|
||||
let snapshot = self.snapshot();
|
||||
|
||||
let files_included = cx
|
||||
.global::<Settings>()
|
||||
|
@ -651,12 +652,11 @@ impl LocalWorktree {
|
|||
files_included,
|
||||
settings::GitFilesIncluded::All | settings::GitFilesIncluded::OnlyTracked
|
||||
) {
|
||||
|
||||
|
||||
let fs = fs.clone();
|
||||
let abs_path = abs_path.clone();
|
||||
let opt_future = async move { fs.load_head_text(&abs_path).await };
|
||||
let results = cx.background().spawn(task).await;
|
||||
let results = if let Some(repo) = snapshot.repo_for(&abs_path) {
|
||||
repo.load_head_text(&abs_path).await
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
if files_included == settings::GitFilesIncluded::All {
|
||||
results.or_else(|| Some(text.clone()))
|
||||
|
|
Loading…
Reference in a new issue