Skip to content

Commit fc3e503

Browse files
authored
remote: Fix incorrect default repository selection when using remote (#41698)
If I understand this correctly: The `active_repo_id` uses `get_or_insert_with`, which makes it dependent on the `RepositoryAdded` event sequence. To ensure correct initialization of the `active_repo_id` on the remote side, the first local `RepositoryAdded` event must synchronously send an `UpdateRepository` to `updates_tx`. Closes #30694 Release Notes: - Fixed incorrect default repository selection when using remote
1 parent 52c49b8 commit fc3e503

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/project/src/git_store.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,12 @@ impl GitStore {
12681268
git_store,
12691269
cx,
12701270
);
1271+
if let Some(updates_tx) = updates_tx.as_ref() {
1272+
// trigger an empty `UpdateRepository` to ensure remote active_repo_id is set correctly
1273+
updates_tx
1274+
.unbounded_send(DownstreamUpdate::UpdateRepository(repo.snapshot()))
1275+
.ok();
1276+
}
12711277
repo.schedule_scan(updates_tx.clone(), cx);
12721278
repo
12731279
});

0 commit comments

Comments
 (0)