Align project panel and git panel deletion behavior (#27525)

This change makes the git panel and project panel behave the same, on
Linux and macOS, and adds prompts.

Release Notes:

- Changed the git panel to prompt before restoring a file.
This commit is contained in:
Mikayla Maki 2025-03-26 14:15:24 -07:00 committed by GitHub
parent 999ad77a59
commit 9e02fee98d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 93 additions and 10 deletions

View file

@ -11,7 +11,9 @@ use anyhow::{anyhow, Context as _, Result};
pub use git2 as libgit;
use gpui::action_with_deprecated_aliases;
use gpui::actions;
use gpui::impl_action_with_deprecated_aliases;
pub use repository::WORK_DIRECTORY_REPO_PATH;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::ffi::OsStr;
use std::fmt;
@ -54,7 +56,13 @@ actions!(
]
);
action_with_deprecated_aliases!(git, RestoreFile, ["editor::RevertFile"]);
#[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema)]
pub struct RestoreFile {
#[serde(default)]
pub skip_prompt: bool,
}
impl_action_with_deprecated_aliases!(git, RestoreFile, ["editor::RevertFile"]);
action_with_deprecated_aliases!(git, Restore, ["editor::RevertSelectedHunks"]);
action_with_deprecated_aliases!(git, Blame, ["editor::ToggleGitBlame"]);