Fix a bug that prevented repositories from being deduplicated (#27884)
Closes #ISSUE Release Notes: - Ensure that only one repository is shown in the git UI when two subdirectories of a repository root are open in Zed
This commit is contained in:
parent
8321e65561
commit
6262a4638b
2 changed files with 51 additions and 1 deletions
|
@ -1062,8 +1062,12 @@ impl GitStore {
|
|||
let mut removed_ids = Vec::new();
|
||||
for update in updated_git_repositories.iter() {
|
||||
if let Some((id, existing)) = self.repositories.iter().find(|(_, repo)| {
|
||||
Some(&repo.read(cx).work_directory_abs_path)
|
||||
let existing_work_directory_abs_path =
|
||||
repo.read(cx).work_directory_abs_path.clone();
|
||||
Some(&existing_work_directory_abs_path)
|
||||
== update.old_work_directory_abs_path.as_ref()
|
||||
|| Some(&existing_work_directory_abs_path)
|
||||
== update.new_work_directory_abs_path.as_ref()
|
||||
}) {
|
||||
if let Some(new_work_directory_abs_path) =
|
||||
update.new_work_directory_abs_path.clone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue