MCPcopy Create free account
hub / github.com/GCWing/BitFun / git_commit

Function git_commit

src/apps/desktop/src/api/git_api.rs:796–831  ·  view source on GitHub ↗
(
    state: State<'_, AppState>,
    request: GitCommitRequest,
)

Source from the content-addressed store, hash-verified

794
795#[tauri::command]
796pub async fn git_commit(
797 state: State<'_, AppState>,
798 request: GitCommitRequest,
799) -> Result<GitOperationResult, String> {
800 if let Some(target) = resolve_remote_git_target(&request.repository_path).await {
801 let mut args = vec![
802 "commit".to_string(),
803 "-m".to_string(),
804 request.params.message.clone(),
805 ];
806 if request.params.amend.unwrap_or(false) {
807 args.push("--amend".to_string());
808 }
809 if request.params.all.unwrap_or(false) {
810 args.push("-a".to_string());
811 }
812 if request.params.no_verify.unwrap_or(false) {
813 args.push("--no-verify".to_string());
814 }
815 if let Some(author) = request.params.author {
816 args.push("--author".to_string());
817 args.push(format!("{} <{}>", author.name, author.email));
818 }
819 return execute_remote_git_operation(&state, &target, &args).await;
820 }
821
822 GitService::commit(&request.repository_path, request.params)
823 .await
824 .map_err(|e| {
825 error!(
826 "Failed to commit: path={}, error={}",
827 request.repository_path, e
828 );
829 format!("Failed to commit: {}", e)
830 })
831}
832
833#[tauri::command]
834pub async fn git_push(

Callers

nothing calls this directly

Calls 3

pushMethod · 0.45

Tested by

no test coverage detected