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);
|
self.file = Some(new_file);
|
||||||
task
|
task
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_git(&mut self, cx: &mut ModelContext<Self>) {
|
pub fn update_git(&mut self, cx: &mut ModelContext<Self>) {
|
||||||
//Grab head text
|
//Grab head text
|
||||||
|
|
||||||
|
|
||||||
self.git_diff_recalc(cx);
|
self.git_diff_recalc(cx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use git2::{Repository as LibGitRepository, RepositoryOpenFlags as LibGitRepositoryOpenFlags};
|
use git2::{Repository as LibGitRepository, RepositoryOpenFlags as LibGitRepositoryOpenFlags};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use std::{path::Path, sync::Arc, ffi::OsStr};
|
use std::{ffi::OsStr, path::Path, sync::Arc};
|
||||||
use util::ResultExt;
|
use util::ResultExt;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -636,6 +636,7 @@ impl LocalWorktree {
|
||||||
let path = Arc::from(path);
|
let path = Arc::from(path);
|
||||||
let abs_path = self.absolutize(&path);
|
let abs_path = self.absolutize(&path);
|
||||||
let fs = self.fs.clone();
|
let fs = self.fs.clone();
|
||||||
|
let snapshot = self.snapshot();
|
||||||
|
|
||||||
let files_included = cx
|
let files_included = cx
|
||||||
.global::<Settings>()
|
.global::<Settings>()
|
||||||
|
@ -651,12 +652,11 @@ impl LocalWorktree {
|
||||||
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) {
|
||||||
|
repo.load_head_text(&abs_path).await
|
||||||
let fs = fs.clone();
|
} else {
|
||||||
let abs_path = abs_path.clone();
|
None
|
||||||
let opt_future = async move { fs.load_head_text(&abs_path).await };
|
};
|
||||||
let results = cx.background().spawn(task).await;
|
|
||||||
|
|
||||||
if files_included == settings::GitFilesIncluded::All {
|
if files_included == settings::GitFilesIncluded::All {
|
||||||
results.or_else(|| Some(text.clone()))
|
results.or_else(|| Some(text.clone()))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue