git: Add uncommit action (#37031)
Closes #36767 Release Notes: - Add uncommit action for git
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user