git: Use worktree paths in the panel (#25950)
This PR changes the git panel to use worktree-relative paths for its entries, instead of repository-relative paths as before. Paths that lie outside the active repository's worktree are no longer shown in the panel. Note that in both respects this is how the project diff editor already works, so this PR brings those two pieces of UI into harmony. Release Notes: - N/A
This commit is contained in:
parent
6faa7cd722
commit
e7b3b8bf03
4 changed files with 233 additions and 96 deletions
|
@ -22,6 +22,7 @@ use editor::ProposedChangesEditorToolbar;
|
|||
use editor::{scroll::Autoscroll, Editor, MultiBuffer};
|
||||
use feature_flags::{FeatureFlagAppExt, FeatureFlagViewExt, GitUiFeatureFlag};
|
||||
use futures::{channel::mpsc, select_biased, StreamExt};
|
||||
use git_ui::git_panel::GitPanel;
|
||||
use git_ui::project_diff::ProjectDiffToolbar;
|
||||
use gpui::{
|
||||
actions, point, px, Action, App, AppContext as _, AsyncApp, Context, DismissEvent, Element,
|
||||
|
@ -429,7 +430,10 @@ fn initialize_panels(
|
|||
workspace.add_panel(chat_panel, window, cx);
|
||||
workspace.add_panel(notification_panel, window, cx);
|
||||
cx.when_flag_enabled::<GitUiFeatureFlag>(window, |workspace, window, cx| {
|
||||
let git_panel = git_ui::git_panel::GitPanel::new(workspace, window, cx);
|
||||
let entity = cx.entity();
|
||||
let project = workspace.project().clone();
|
||||
let app_state = workspace.app_state().clone();
|
||||
let git_panel = cx.new(|cx| GitPanel::new(entity, project, app_state, window, cx));
|
||||
workspace.add_panel(git_panel, window, cx);
|
||||
});
|
||||
})?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue