Feature: Supports remote branch deletion
This commit is contained in:
@@ -451,6 +451,32 @@ pub async fn git_delete_branch(
|
||||
Ok(Json(()))
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GitDeleteRemoteBranchParams {
|
||||
pub path: String,
|
||||
pub remote: String,
|
||||
pub branch: String,
|
||||
pub credentials: Option<GitCredentials>,
|
||||
}
|
||||
|
||||
pub async fn git_delete_remote_branch(
|
||||
Extension(state): Extension<Arc<AppState>>,
|
||||
Json(params): Json<GitDeleteRemoteBranchParams>,
|
||||
) -> Result<Json<()>, AppCommandError> {
|
||||
let db = &state.db;
|
||||
folder_commands::git_delete_remote_branch_core(
|
||||
¶ms.path,
|
||||
¶ms.remote,
|
||||
¶ms.branch,
|
||||
params.credentials.as_ref(),
|
||||
db,
|
||||
&state.data_dir,
|
||||
)
|
||||
.await?;
|
||||
Ok(Json(()))
|
||||
}
|
||||
|
||||
pub async fn git_list_conflicts(
|
||||
Json(params): Json<PathParams>,
|
||||
) -> Result<Json<Vec<String>>, AppCommandError> {
|
||||
|
||||
@@ -106,6 +106,7 @@ pub fn build_router(state: Arc<AppState>, token: String, static_dir: std::path::
|
||||
.route("/git_fetch", post(handlers::git::git_fetch))
|
||||
.route("/git_commit", post(handlers::git::git_commit))
|
||||
.route("/git_fetch_remote", post(handlers::git::git_fetch_remote))
|
||||
.route("/git_delete_remote_branch", post(handlers::git::git_delete_remote_branch))
|
||||
.route("/clone_repository", post(handlers::git::clone_repository))
|
||||
// ─── Files ───
|
||||
.route("/read_file_preview", post(handlers::files::read_file_preview))
|
||||
|
||||
Reference in New Issue
Block a user