git: Add uncommit action (#37031)

Closes #36767

Release Notes:

- Add uncommit action for git
This commit is contained in:
Alvaro Parker
2025-09-09 13:29:49 -06:00
committed by GitHub
parent 2e36e9782e
commit 0862a0b666
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -1738,7 +1738,7 @@ impl GitPanel {
self.pending_commit = Some(task);
}
fn uncommit(&mut self, window: &mut Window, cx: &mut Context<Self>) {
pub(crate) fn uncommit(&mut self, window: &mut Window, cx: &mut Context<Self>) {
let Some(repo) = self.active_repository.clone() else {
return;
};
+8
View File
@@ -149,6 +149,14 @@ pub fn init(cx: &mut App) {
panel.unstage_all(action, window, cx);
});
});
workspace.register_action(|workspace, _: &git::Uncommit, window, cx| {
let Some(panel) = workspace.panel::<git_panel::GitPanel>(cx) else {
return;
};
panel.update(cx, |panel, cx| {
panel.uncommit(window, cx);
})
});
CommandPaletteFilter::update_global(cx, |filter, _cx| {
filter.hide_action_types(&[
zed_actions::OpenGitIntegrationOnboarding.type_id(),