feat(title-bar): add folder-actions menu and branch dropdown with git operations

This commit is contained in:
xintaofei
2026-04-22 00:23:27 +08:00
parent 08fb508736
commit f3bdf94723
19 changed files with 1511 additions and 46 deletions

View File

@@ -2120,6 +2120,29 @@ pub async fn git_rebase(
})
}
#[cfg_attr(feature = "tauri-runtime", tauri::command)]
pub async fn git_delete_branch(
path: String,
branch_name: String,
force: bool,
) -> Result<String, AppCommandError> {
let flag = if force { "-D" } else { "-d" };
let output = crate::process::tokio_command("git")
.args(["branch", flag, &branch_name])
.current_dir(&path)
.output()
.await
.map_err(AppCommandError::io)?;
if !output.status.success() {
return Err(git_command_error(
&format!("branch {flag}"),
&output.stderr,
));
}
Ok(String::from_utf8_lossy(&output.stdout).trim().to_string())
}
pub(crate) async fn git_delete_remote_branch_core(
path: &str,
remote: &str,