Load diff base from correct relative path
This commit is contained in:
parent
836b536a90
commit
3f4be5521c
2 changed files with 15 additions and 8 deletions
|
@ -667,13 +667,15 @@ impl LocalWorktree {
|
|||
cx.spawn(|this, mut cx| async move {
|
||||
let text = fs.load(&abs_path).await?;
|
||||
|
||||
let diff_base = if let Some(repo) = snapshot.repo_for(&abs_path) {
|
||||
cx.background()
|
||||
.spawn({
|
||||
let path = path.clone();
|
||||
async move { repo.repo.lock().load_index(&path) }
|
||||
})
|
||||
.await
|
||||
let diff_base = if let Some(repo) = snapshot.repo_for(&path) {
|
||||
if let Ok(repo_relative) = path.strip_prefix(repo.content_path) {
|
||||
let repo_relative = repo_relative.to_owned();
|
||||
cx.background()
|
||||
.spawn(async move { repo.repo.lock().load_index(&repo_relative) })
|
||||
.await
|
||||
} else {
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue