Add branch rename action to Git panel (#38273)
Reopening #35136, cc @launay12u Release Notes: - git: added `git: rename branch` action to rename a branch (`git branch -m`) --------- Co-authored-by: Guillaume Launay <guillaume.launay@paylead.fr> Co-authored-by: Peter Tripp <petertripp@gmail.com>
This commit is contained in:
co-authored by
Guillaume Launay
Peter Tripp
parent
df50b5c14a
commit
439d31e2d4
@@ -11,6 +11,7 @@ pub use crate::remote::*;
|
||||
use anyhow::{Context as _, Result};
|
||||
pub use git2 as libgit;
|
||||
use gpui::{Action, actions};
|
||||
pub use repository::RemoteCommandOutput;
|
||||
pub use repository::WORK_DIRECTORY_REPO_PATH;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@@ -101,6 +102,18 @@ actions!(
|
||||
]
|
||||
);
|
||||
|
||||
/// Renames a git branch.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = git)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct RenameBranch {
|
||||
/// The branch to rename.
|
||||
///
|
||||
/// Default: the current branch.
|
||||
#[serde(default)]
|
||||
pub branch: Option<String>,
|
||||
}
|
||||
|
||||
/// Restores a file to its last committed state, discarding local changes.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Deserialize, JsonSchema, Action)]
|
||||
#[action(namespace = git, deprecated_aliases = ["editor::RevertFile"])]
|
||||
|
||||
Reference in New Issue
Block a user