mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-04 22:54:24 +00:00
Fix panic from unwrapping a relativize() (#6459)
Release Notes: - Fixed a panic that could occur finding a git repository.
This commit is contained in:
commit
cf3b2ba146
1 changed files with 8 additions and 7 deletions
|
@ -970,7 +970,7 @@ impl LocalWorktree {
|
|||
let mut index_task = None;
|
||||
let snapshot = this.update(&mut cx, |this, _| this.as_local().unwrap().snapshot())?;
|
||||
if let Some(repo) = snapshot.repository_for_path(&path) {
|
||||
let repo_path = repo.work_directory.relativize(&snapshot, &path).unwrap();
|
||||
if let Some(repo_path) = repo.work_directory.relativize(&snapshot, &path) {
|
||||
if let Some(repo) = snapshot.git_repositories.get(&*repo.work_directory) {
|
||||
let repo = repo.repo_ptr.clone();
|
||||
index_task = Some(
|
||||
|
@ -979,6 +979,7 @@ impl LocalWorktree {
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let diff_base = if let Some(index_task) = index_task {
|
||||
index_task.await
|
||||
|
|
Loading…
Reference in a new issue