Fix a bug causing stale optimistic state in the git panel (#28588)
Release Notes: - Fixed a bug that caused the staged status of files in the git panel to be out of date in some cases.
This commit is contained in:
parent
7caa2c2ea0
commit
66b3e03baa
3 changed files with 14 additions and 8 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -3180,7 +3180,6 @@ dependencies = [
|
||||||
"collections",
|
"collections",
|
||||||
"component",
|
"component",
|
||||||
"db",
|
"db",
|
||||||
"futures 0.3.31",
|
|
||||||
"gpui",
|
"gpui",
|
||||||
"languages",
|
"languages",
|
||||||
"notifications",
|
"notifications",
|
||||||
|
@ -3188,7 +3187,6 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"ui",
|
"ui",
|
||||||
"ui_input",
|
"ui_input",
|
||||||
"util",
|
|
||||||
"workspace",
|
"workspace",
|
||||||
"workspace-hack",
|
"workspace-hack",
|
||||||
]
|
]
|
||||||
|
|
|
@ -3796,12 +3796,6 @@ impl Repository {
|
||||||
updates_tx: Option<mpsc::UnboundedSender<DownstreamUpdate>>,
|
updates_tx: Option<mpsc::UnboundedSender<DownstreamUpdate>>,
|
||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) {
|
) {
|
||||||
self.paths_changed(
|
|
||||||
vec![git::repository::WORK_DIRECTORY_REPO_PATH.clone()],
|
|
||||||
updates_tx.clone(),
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
|
|
||||||
let this = cx.weak_entity();
|
let this = cx.weak_entity();
|
||||||
let _ = self.send_keyed_job(
|
let _ = self.send_keyed_job(
|
||||||
Some(GitJobKey::ReloadGitState),
|
Some(GitJobKey::ReloadGitState),
|
||||||
|
|
|
@ -2070,6 +2070,20 @@ async fn test_select_git_entry(cx: &mut gpui::TestAppContext) {
|
||||||
cx,
|
cx,
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
let (scan1_complete, scan2_complete) = project.update(cx, |project, cx| {
|
||||||
|
let mut worktrees = project.worktrees(cx);
|
||||||
|
let worktree1 = worktrees.next().unwrap();
|
||||||
|
let worktree2 = worktrees.next().unwrap();
|
||||||
|
(
|
||||||
|
worktree1.read(cx).as_local().unwrap().scan_complete(),
|
||||||
|
worktree2.read(cx).as_local().unwrap().scan_complete(),
|
||||||
|
)
|
||||||
|
});
|
||||||
|
scan1_complete.await;
|
||||||
|
scan2_complete.await;
|
||||||
|
cx.run_until_parked();
|
||||||
|
|
||||||
let workspace = cx.add_window(|window, cx| Workspace::test_new(project.clone(), window, cx));
|
let workspace = cx.add_window(|window, cx| Workspace::test_new(project.clone(), window, cx));
|
||||||
let cx = &mut VisualTestContext::from_window(*workspace, cx);
|
let cx = &mut VisualTestContext::from_window(*workspace, cx);
|
||||||
let panel = workspace.update(cx, ProjectPanel::new).unwrap();
|
let panel = workspace.update(cx, ProjectPanel::new).unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue