add an argument to RenameBranch

Cole Miller and Peter Tripp created

Co-authored-by: Peter Tripp <petertripp@gmail.com>

Change summary

crates/git/src/git.rs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

Detailed changes

crates/git/src/git.rs 🔗

@@ -96,11 +96,21 @@ actions!(
         OpenModifiedFiles,
         /// Clones a repository.
         Clone,
-        /// Renames the current branch.
-        RenameBranch,
     ]
 );
 
+/// 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"])]