Sync git button states between project diff & git panel (#26938)

Closes #ISSUE

Release Notes:

- Git action buttons are now synced between the project diff and git
panel

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
This commit is contained in:
Anthony Eid 2025-03-17 14:08:32 -04:00 committed by GitHub
parent 430bd83e4d
commit db1d2defa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 74 additions and 108 deletions

View file

@ -7,9 +7,8 @@ use git::{
status::{FileStatus, StatusCode, UnmergedStatus, UnmergedStatusCode},
};
use git_panel_settings::GitPanelSettings;
use gpui::{actions, App, Entity, FocusHandle};
use gpui::{actions, App, FocusHandle};
use onboarding::{clear_dismissed, GitOnboardingModal};
use project::Project;
use project_diff::ProjectDiff;
use ui::prelude::*;
use workspace::Workspace;
@ -120,10 +119,6 @@ pub fn git_status_icon(status: FileStatus) -> impl IntoElement {
GitStatusIcon::new(status)
}
fn can_push_and_pull(project: &Entity<Project>, cx: &App) -> bool {
!project.read(cx).is_via_collab()
}
fn render_remote_button(
id: impl Into<SharedString>,
branch: &Branch,