From cf2878c23389cee80e4898ecfa396294d80c2c5a Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 24 Sep 2026 11:19:10 +0800 Subject: [PATCH] test(scm): key the tree test's settle on the panel's own root --- src/ui/scm/panel.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ui/scm/panel.rs b/src/ui/scm/panel.rs index cd9956ae..1bd1c430 100644 --- a/src/ui/scm/panel.rs +++ b/src/ui/scm/panel.rs @@ -3224,11 +3224,15 @@ mod render_idle_gpui_tests { std::fs::write(root.join("src/ui/b.rs"), "b\n").unwrap(); std::fs::write(root.join("docs/readme.md"), "r\n").unwrap(); - let want = root.clone(); - let (app, mut vcx, _pane) = scm_panel_on(cx, &root, move |app, cx| { - app.scm.repo.as_ref().is_some_and(|r| r.root == want) - && crate::terminal::git_data::status_of(cx, HostId::LOCAL, &want) + // Keyed off the root the panel resolved, not off `root`: on Windows + // `scratch` hands back a `\\?\` verbatim path that never compares + // equal to git's spelling of the same directory — see the note on + // `a_settled_source_control_panel_reaches_render_idle`. + let (app, mut vcx, _pane) = scm_panel_on(cx, &root, |app, cx| { + app.scm.repo.as_ref().is_some_and(|r| { + crate::terminal::git_data::status_of(cx, r.host, &r.root) .is_some_and(|s| s.untracked().count() == 3) + }) }); let drawn = |vcx: &mut VisualTestContext, what: &'static str| { app.update_in(vcx, |_, _, cx| cx.notify());